C++ method chaining including class constructor
- by jena
Hello,
I'm trying to implement method chaining in C++, which turns out to be quite easy if the constructor call of a class is a separate statement, e.g:
Foo foo;
foo.bar().baz();
But as soon as the constructor call becomes part of the method chain, the compiler complains about expecting ";" in place of "." immediately after the constructor…