Boost logo

Boost :

From: Samuel Krempp (krempp_at_[hidden])
Date: 2001-06-25 05:56:07


I am using boost::format (v0.7) happily for some time.

Recently I tried compiling the example program, and g++ (compiled from a
recent 3.1 cvs ) refused because of some copy ctors of members of basic_stringstream
being private.

Is there a reason why parameters are copied instead of passed by
reference in those ctors :
    template<typename A>
    basic_format(const charT* ca, A a);
(idem for all multi-argument ctors..)

Because, when A is boost::format, as needed in
  std::cout << format("The Truth is %1", format("%1 != %2", 1, 2)) <<
'\n';
that implies copying a basic_stringstream, and that is not allowed.

using the following ctors, the test program compiled and ran correctly :
    template<typename A>
    basic_format(const charT* ca, const A& a);

and I humbly think this is the way it should be..

-- 
Sam

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk