codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <cstdlib> #include <string> #include <sstream> #include <iostream> struct Formatter { template<class Field> Formatter& operator<<(Field const &f) { ss_ << f; return *this; } operator std::string() const { return ss_.str(); } std::stringstream ss_; }; void Reject(const std::string& msg) { std::cout << "Recieved Message: '" << msg << "'" << std::endl; } int main() { const char& some_code = 'A'; const char* some_msg = "Something"; Reject(Formatter() << std::endl); }
Private
[
?
]
Run code
Submit