diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 68240463..e64507cf 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -54,6 +54,17 @@ namespace ns {} }; #endif + + struct foo + { + int x; + }; + + struct bar + { + foo foo_; + int y; + }; } BOOST_FUSION_ADAPT_STRUCT( @@ -73,6 +84,12 @@ BOOST_FUSION_ADAPT_STRUCT( struct s { int m; }; BOOST_FUSION_ADAPT_STRUCT(s, (int, m)) +BOOST_FUSION_ADAPT_STRUCT( + ns::bar, + (int, foo_.x) // test that adapted members can actually be expressions + (int, y) +) + int main() { @@ -159,6 +176,15 @@ main() } #endif + { + fusion::vector v1(4, 2); + ns::bar v2 = {5, 3}; + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + } + return boost::report_errors(); }