mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-12 14:54:10 +00:00
fix apply_visitor.
This commit is contained in:
parent
8b80b159c8
commit
16e7ddf0bf
3 changed files with 18 additions and 6 deletions
|
@ -170,6 +170,18 @@ namespace testspr {
|
|||
TESTSPR_ASSERT(var3.which() == 0);
|
||||
TESTSPR_ASSERT(sprout::get<int>(var3) == 0);
|
||||
}
|
||||
{
|
||||
testspr::x2_visitor<double> visitor1 = {};
|
||||
TESTSPR_BOTH_ASSERT(sprout::apply_visitor(visitor1, var1) == 2.0);
|
||||
TESTSPR_BOTH_ASSERT(sprout::apply_visitor(visitor1, var2) == 0.0);
|
||||
}
|
||||
{
|
||||
auto var3 = var2;
|
||||
testspr::x2_assign_visitor<double> visitor1 = {};
|
||||
TESTSPR_ASSERT(sprout::apply_visitor(visitor1, var3) == 0.0);
|
||||
TESTSPR_ASSERT(var3.which() == 0);
|
||||
TESTSPR_ASSERT(sprout::get<int>(var3) == 0);
|
||||
}
|
||||
|
||||
// operator<<
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue