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

2012-10-20 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,

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 rich...@metafoo.co.uk wrote: On Fri, Oct 19, 2012 at 10:50 PM, Chandler Carruth chandl...@google.com wrote: On Fri, Oct 19, 2012 at 10:04 PM, Richard Smith rich...@metafoo.co.uk wrote: [Crossposted to both GCC and Clang dev lists] Hi, One

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 chandl...@google.com wrote: On Fri, Oct 19, 2012 at 10:04 PM, Richard Smith rich...@metafoo.co.uk 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

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 andyg1...@hotmail.co.uk 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) {

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 chandl...@google.com wrote: On Fri, Oct 19, 2012 at 10:04 PM, Richard Smith rich...@metafoo.co.uk 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

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 jordan_r...@apple.com 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

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 g...@integrable-solutions.net wrote: On Sat, Oct 20, 2012 at 2:24 PM, Jordan Rose jordan_r...@apple.com wrote: While throwing things out there, why not just optionally allow constexpr functions to coexist with non-constexpr functions of the

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 rich...@metafoo.co.uk 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

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 rich...@metafoo.co.uk wrote: On Sat, Oct 20, 2012 at 7:36 PM, Gabriel Dos Reis g...@integrable-solutions.net wrote: On Sat, Oct 20, 2012 at 2:24 PM, Jordan Rose jordan_r...@apple.com wrote: While throwing things out there, why not just optionally

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 rich...@metafoo.co.uk 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

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 chandl...@google.com wrote: On Fri, Oct 19, 2012 at 10:04 PM, Richard Smith rich...@metafoo.co.uk wrote: [Crossposted to both GCC and Clang dev lists] Hi, One issue facing library authors wanting to use C++11's constexpr feature