void testOrderedSlotConnections() { boost::signals2::signal<void ()> sig; sig.connect(1, World()); // connect with group 1 sig.connect(0, Hello()); // connect with group 0 //sig.connect(GoodMorning(), boost::signals2::at_front); sig.connect(GoodMorning()); // ungrouped // slots are invoked this order: // 1) ungrouped slots connected with boost::signals2::at_front // 2) grouped slots according to ordering of their groups // 3) ungrouped slots connected with boost::signals2::at_back sig(); }
int main() { //[ hello_world_ordered_code_snippet boost::signals2::signal<void ()> sig; sig.connect(1, World()); // connect with group 1 sig.connect(0, Hello()); // connect with group 0 //] //[ hello_world_ordered_invoke_code_snippet // by default slots are connected at the end of the slot list sig.connect(GoodMorning()); // slots are invoked this order: // 1) ungrouped slots connected with boost::signals2::at_front // 2) grouped slots according to ordering of their groups // 3) ungrouped slots connected with boost::signals2::at_back sig(); //] return 0; };