Re: [cfe-dev] C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-20 Thread Jordan Rose
On Oct 20, 2012, at 20:23 , Richard Smith wrote: > On Sat, Oct 20, 2012 at 7:36 PM, Gabriel Dos Reis > wrote: >> On Sat, Oct 20, 2012 at 2:24 PM, Jordan Rose wrote: >>> While throwing things out there, why not just optionally allow constexpr >>> functions to coexist with non-constexpr functio

Re: [cfe-dev] C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-20 Thread Gabriel Dos Reis
On Sat, Oct 20, 2012 at 10:23 PM, Richard Smith wrote: >> Allow loops and the like in constexpr functions and be done with it. See my >> comments on the C++ Extension Working Group when these (and related) >> issues where brought up. > > Yes, I completely agree, but I don't think this solves the

Re: [cfe-dev] C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-20 Thread Richard Smith
On Sat, Oct 20, 2012 at 7:36 PM, Gabriel Dos Reis wrote: > On Sat, Oct 20, 2012 at 2:24 PM, Jordan Rose wrote: >> While throwing things out there, why not just optionally allow constexpr >> functions to coexist with non-constexpr functions of the same name, like >> inline and non-inline? I thi

Re: [cfe-dev] C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-20 Thread Gabriel Dos Reis
On Sat, Oct 20, 2012 at 2:24 PM, Jordan Rose wrote: > While throwing things out there, why not just optionally allow constexpr > functions to coexist with non-constexpr functions of the same name, like > inline and non-inline? Or remove most of the restrictions on constexpr functions that were

Re: [cfe-dev] C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-20 Thread Gabriel Dos Reis
On Sat, Oct 20, 2012 at 12:53 AM, Chandler Carruth wrote: > On Fri, Oct 19, 2012 at 10:04 PM, Richard Smith wrote: >> >> [Crossposted to both GCC and Clang dev lists] >> >> Hi, >> >> One issue facing library authors wanting to use C++11's constexpr feature is >> that the same implementation must

Re: [cfe-dev] C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-20 Thread Jordan Rose
On Oct 19, 2012, at 23:27 , Andy Gibbs wrote: > On Saturday, October 20, 2012 7:50 AM, Chandler Carruth wrote: >> [...snip...] Let me hypothesize a different interface: >> >> This stays the same... >> constexpr int constexpr_strncmp(const char *p, const char *q, size_t n) { >> return !n ? 0 : *

Re: [cfe-dev] C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-20 Thread Jeffrey Yasskin
On Fri, Oct 19, 2012 at 10:50 PM, Chandler Carruth wrote: > On Fri, Oct 19, 2012 at 10:04 PM, Richard Smith > wrote: >> >> [Crossposted to both GCC and Clang dev lists] >> >> Hi, >> >> One issue facing library authors wanting to use C++11's constexpr feature >> is that the same implementation mus

Re: [cfe-dev] C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-20 Thread Howard Hinnant
On Oct 19, 2012, at 10:51 PM, Richard Smith wrote: > > On Fri, Oct 19, 2012 at 10:50 PM, Chandler Carruth > wrote: > On Fri, Oct 19, 2012 at 10:04 PM, Richard Smith wrote: > [Crossposted to both GCC and Clang dev lists] > > Hi, > > One issue facing library authors wanting to use C++11's con

Re: C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-19 Thread Andy Gibbs
On Saturday, October 20, 2012 7:50 AM, Chandler Carruth wrote: [...snip...] Let me hypothesize a different interface: This stays the same... constexpr int constexpr_strncmp(const char *p, const char *q, size_t n) { return !n ? 0 : *p != *q ? *p - *q : !*p ? 0 : constexpr_strncmp(p+1, q+1, n-1)

Re: [cfe-dev] C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-19 Thread Richard Smith
On Fri, Oct 19, 2012 at 10:53 PM, Chandler Carruth wrote: > > On Fri, Oct 19, 2012 at 10:04 PM, Richard Smith > wrote: > > > > [Crossposted to both GCC and Clang dev lists] > > > > Hi, > > > > One issue facing library authors wanting to use C++11's constexpr > > feature is that the same implement

Re: [cfe-dev] C++11: new builtin to allow constexpr to be applied to performance-critical functions

2012-10-19 Thread Chandler Carruth
On Fri, Oct 19, 2012 at 10:04 PM, Richard Smith wrote: > > [Crossposted to both GCC and Clang dev lists] > > Hi, > > One issue facing library authors wanting to use C++11's constexpr feature is > that the same implementation must be provided for both the case of function > invocation substitutio