fork download
  1. // function compositions with bind
  2. BOOST_CHECK(bind(&sum_of_args_3, bind(&sum_of_args_2, _1, 2), 2, 3)(i)==8);
  3. BOOST_CHECK(
  4. bind(&sum_of_args_9,
  5. bind(&sum_of_args_0), // 0
  6. bind(&sum_of_args_1, _1), // 1
  7. bind(&sum_of_args_2, _1, _2), // 3
  8. bind(&sum_of_args_3, _1, _2, _3), // 6
  9. bind(&sum_of_args_4, _1, _2, _3, 4), // 10
  10. bind(&sum_of_args_5, _1, _2, _3, 4, 5), // 15
  11. bind(&sum_of_args_6, _1, _2, _3, 4, 5, 6), // 21
  12. bind(&sum_of_args_7, _1, _2, _3, 4, 5, 6, 7), // 28
  13. bind(&sum_of_args_8, _1, _2, _3, 4, 5, 6, 7, 8) // 36
  14. )(i, j, k) == 120);
  15.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:18: error: expected constructor, destructor, or type conversion before ‘(’ token
       BOOST_CHECK(bind(&sum_of_args_3, bind(&sum_of_args_2, _1, 2), 2, 3)(i)==8); 
                  ^
prog.cpp:3:18: error: expected constructor, destructor, or type conversion before ‘(’ token
       BOOST_CHECK(
                  ^
stdout
Standard output is empty