Re: Quick C++ question for C++ experts :)

2015-04-08 Thread Jonathan Wakely
On 02/04/15 10:34 +0100, Ian Malone wrote: Thanks. Hadn't occurred to me the + operator here was a template as I'd never had to deal with basic_string. Still a bit puzzled as cplusplus.com says string is an instantiation of basic_string while cppreference.com says it's a typedef (which I guess do

Re: Quick C++ question for C++ experts :)

2015-04-02 Thread Ian Malone
On 1 April 2015 at 16:09, Jonathan Wakely wrote: > On 01/04/15 15:16 +0100, Ian Malone wrote: >> >> Do you mind clarifying? I thought should provide that >> http://www.cplusplus.com/reference/string/string/operator+/ or is that >> what fno-implicit-templates is turning off? > > > Of course string

Re: Quick C++ question for C++ experts :)

2015-04-01 Thread Jonathan Wakely
On 01/04/15 15:16 +0100, Ian Malone wrote: Do you mind clarifying? I thought should provide that http://www.cplusplus.com/reference/string/string/operator+/ or is that what fno-implicit-templates is turning off? Of course string provides it, but it's a template, so it needs to be instantiated.

Re: Quick C++ question for C++ experts :)

2015-04-01 Thread Ian Malone
On 1 April 2015 at 14:32, Jonathan Wakely wrote: > On 28/03/15 16:45 -0300, Paulo César Pereira de Andrade wrote: >> >> 2015-03-28 16:06 GMT-03:00 Paulo César Pereira de Andrade >> : >>> >>> Is this expected to not compile with -fno-implicit-templates? >>> >>> ---%<--- >>> $ cat test.cc >>> #inclu

Re: Quick C++ question for C++ experts :)

2015-04-01 Thread Jonathan Wakely
On 28/03/15 16:45 -0300, Paulo César Pereira de Andrade wrote: 2015-03-28 16:06 GMT-03:00 Paulo César Pereira de Andrade : Is this expected to not compile with -fno-implicit-templates? ---%<--- $ cat test.cc #include std::string test(int i) { std::string t; std::string s = "("; t =

Re: Quick C++ question for C++ experts :)

2015-03-28 Thread Paulo César Pereira de Andrade
2015-03-28 16:06 GMT-03:00 Paulo César Pereira de Andrade : > Is this expected to not compile with -fno-implicit-templates? > > ---%<--- > $ cat test.cc > #include > std::string test(int i) > { > std::string t; > std::string s = "("; > t = ""; > for (int r = i; r; r>>=1) { >