7 template <
typename Result,
typename Callable,
typename... Args>
8 Result
invoke(Callable callable, Args... args) noexcept
10 return reinterpret_cast<Result (*)(Args...)
>(callable)(args...);
14 template <
typename Result,
typename... Args>
17 return invoke<Result>(objc_msgSend, args...);
20 inline id operator"" _cls(
const char* s, std::size_t)
22 return reinterpret_cast<id>(objc_getClass(s));
24 inline SEL operator"" _sel(
const char* s, std::size_t)
26 return sel_registerName(s);
28 inline id operator"" _str(
const char* s, std::size_t)
30 return msg_send<id>(
"NSString"_cls,
"stringWithUTF8String:"_sel, s);
Result msg_send(Args... args) noexcept
Definition: helpers.hpp:15
Result invoke(Callable callable, Args... args) noexcept
Definition: helpers.hpp:8