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
Post a Comment