Also, it provides the following operations:
context()
, which returns a context_type &
reference
Example:
struct write_to_file : destination_base, destination::non_const_context<std::ofstream> { write_to_file(const char* filename) : non_const_context_base(filename) {} void operator()(param msg) const { context() << msg ; } };
write_to_file a, b = a; a.file_name("t1.txt"); // a == b (a's state == b's state) write_to_file c, d; c.file_name("t2.txt"); // c != d (c's state != d's state) d = c; c.file_name("t3.txt"); // c == d (c's state == d's state)