I recently used a library that allows the following type of syntax:
MyClass myObject;
myObject
.setMember1(\"string value\")
.setMember2(4.0f)
.s
This is sometimes referred to as the Named Parameter Idiom or method chaining. This isn't bad practice, it can aid readability. Consider this example lifted from the C++ FAQ
File f = OpenFile("foo.txt")
.readonly()
.createIfNotExist()
.appendWhenWriting()
.blockSize(1024)
.unbuffered()
.exclusiveAccess();
The alternative would be to use positional arguments to the OpenFile method, requiring the programmer to remember the position of each argument.