Created
November 8, 2015 07:48
-
-
Save imerr/2e71eace7d9a25b740f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/fusion/include/adapt_struct.hpp> | |
#include <boost/fusion/include/for_each.hpp> | |
#include <iostream> | |
struct TestThing { | |
int bla; | |
char blabla[10]; | |
}; | |
BOOST_FUSION_ADAPT_STRUCT( | |
TestThing, | |
bla, | |
blabla | |
); | |
struct FuncThing { | |
void operator() (int& bla) const { | |
std::cout << "Int" << std::endl; | |
} | |
// Wrong | |
void operator() (const char bla[10]) const { | |
std::cout << "Const Char [10]" << std::endl; | |
} | |
// should be correct though | |
void operator() (char bla[10]) const { | |
std::cout << "Char [10]" << std::endl; | |
} | |
}; | |
int main () { | |
TestThing bla; | |
FuncThing f; | |
boost::fusion::for_each(bla, f); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment