C++ What is the % operator doing here? -


i encountered code similar this:

std::string mystring = "test"; boost::format fmt("%s");  fmt % mystring; 

what (second) % operator doing here?

edit:

i understand end result, not find definition of how % operator can used this.

can provide example explains meaning of % operator here?

i understand end result, not find definition of how % operator can used this.

operator % can overloaded. boost.format basic_format class:

template<class t>   basic_format&   operator%(const t& x)     { return io::detail::feed<chart, tr, alloc, const t&>(*this,x); } 

this member function gets invoked whenever use code fmt % value fmt of type boost::basic_format<ch>.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -