Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10439: Flyweight: now the constructor is explicit
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-09-01 09:10:45
#10439: Flyweight: now the constructor is explicit
----------------------------------------------+-----------------------
Reporter: akim Demaille <akim.demaille@â¦> | Owner: joaquin
Type: Bugs | Status: new
Milestone: To Be Determined | Component: flyweight
Version: Boost 1.56.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------------------+-----------------------
Comment (by Akim Demaille <akim.demaille@â¦>):
The following also used to work up to 1.55, and is now broken.
{{{
$ cat foo.cc
#include <string>
#include <boost/flyweight.hpp>
using string = boost::flyweight<std::string>;
void foo(string) {}
int main()
{
foo({});
}
$ clang++-mp-3.5 -std=c++11 -I /opt/local/include foo.cc
foo.cc:10:3: error: no matching function for call to 'foo'
foo({});
^~~
foo.cc:6:6: note: candidate function not viable: cannot convert
initializer list argument to 'string' (aka 'flyweight<std::string>')
void foo(string) {}
^
1 error generated.
$ g++-mp-4.9 -std=c++11 -I /opt/local/include foo.cc
foo.cc: In function 'int main()':
foo.cc:10:9: error: converting to 'string {aka
boost::flyweights::flyweight<std::basic_string<char> >}' from initializer
list would use explicit constructor 'boost::flyweights::flyweight<T, Arg1,
Arg2, Arg3, Arg4, Arg5>::flyweight(Args&& ...) [with Args = {}; T =
std::basic_string<char>; Arg1 = boost::parameter::void_; Arg2 =
boost::parameter::void_; Arg3 = boost::parameter::void_; Arg4 =
boost::parameter::void_; Arg5 = boost::parameter::void_]'
foo({});
^
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10439#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC