Skip to content

Instantly share code, notes, and snippets.

@Cylix
Created October 19, 2020 06:03
Show Gist options
  • Save Cylix/89ed4a6662775785b7c518201527ec40 to your computer and use it in GitHub Desktop.
Save Cylix/89ed4a6662775785b7c518201527ec40 to your computer and use it in GitHub Desktop.
Reflection in C++14 - Macros #4
//! macro to convert any kind of value to string
#define __REFLEX_TO_STRING(val) #val
//! macro called for each member function to build a pair of <string, member_function_pointer>
#define __REFLEX_MAKE_REGISTERABLE_FUNCTION(r, type, i, function) \
BOOST_PP_COMMA_IF(i) std::make_pair(std::string(__REFLEX_TO_STRING(function)), &type::function)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment