mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-15 21:32:22 +02:00
test that adapted members can actually be expressions
This commit is contained in:
@ -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<int, float> 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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user