mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-25 10:07:24 +02:00
update from trunk fixing http://boost.2283326.n4.nabble.com/fusion-g-4-6-deque-and-c-0x-compile-error-td4632499.html
[SVN r79958]
This commit is contained in:
@ -71,6 +71,24 @@ namespace ns
|
||||
int y;
|
||||
};
|
||||
#endif
|
||||
|
||||
// A sequence that has data members defined in an unrelated namespace
|
||||
// (std, in this case). This allows testing ADL issues.
|
||||
class name
|
||||
{
|
||||
public:
|
||||
name() {}
|
||||
name(const std::string& last, const std::string& first)
|
||||
: last(last), first(first) {}
|
||||
|
||||
const std::string& get_last() const { return last; }
|
||||
const std::string& get_first() const { return first; }
|
||||
void set_last(const std::string& last_) { last = last_; }
|
||||
void set_first(const std::string& first_) { first = first_; }
|
||||
private:
|
||||
std::string last;
|
||||
std::string first;
|
||||
};
|
||||
}
|
||||
|
||||
BOOST_FUSION_ADAPT_ADT(
|
||||
@ -87,6 +105,12 @@ BOOST_FUSION_ADAPT_ADT(
|
||||
)
|
||||
#endif
|
||||
|
||||
BOOST_FUSION_ADAPT_ADT(
|
||||
ns::name,
|
||||
(const std::string&, const std::string&, obj.get_last(), obj.set_last(val))
|
||||
(const std::string&, const std::string&, obj.get_first(), obj.set_first(val))
|
||||
)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
@ -131,6 +155,20 @@ main()
|
||||
BOOST_TEST(v3 >= v2);
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<std::string, std::string> v1("Lincoln", "Abraham");
|
||||
ns::name v2("Roosevelt", "Franklin");
|
||||
ns::name v3("Roosevelt", "Theodore");
|
||||
BOOST_TEST(v1 < v2);
|
||||
BOOST_TEST(v1 <= v2);
|
||||
BOOST_TEST(v2 > v1);
|
||||
BOOST_TEST(v2 >= v1);
|
||||
BOOST_TEST(v2 < v3);
|
||||
BOOST_TEST(v2 <= v3);
|
||||
BOOST_TEST(v3 > v2);
|
||||
BOOST_TEST(v3 >= v2);
|
||||
}
|
||||
|
||||
{
|
||||
// conversion from ns::point to vector
|
||||
ns::point p(5, 3);
|
||||
|
Reference in New Issue
Block a user