Re: constexpr static member function

Discussion in 'C++' started by Victor Bazarov, Mar 1, 2013.

  1. On 3/1/2013 11:19 AM, Juha Nieminen wrote:
    > For some reason this doesn't compile with the latest clang:
    >
    > class MyClass
    > {
    > public:
    > static constexpr int something(int);
    > };
    >
    > constexpr int MyClass::something(int i) { return i+1; }
    >
    > The error message is "Conflicting types for 'something'".
    >
    > Is this a limitation in clang, in C++11, or am I using the wrong syntax?


    Have you tried moving 'constexpr' before 'static'?

    V
    --
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Mar 1, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. 0to60
    Replies:
    4
    Views:
    535
    jeffc
    Nov 21, 2003
  2. aling
    Replies:
    6
    Views:
    498
    Xiaobin.Huang
    Oct 30, 2005
  3. dolphin
    Replies:
    3
    Views:
    1,377
    Pete Becker
    Dec 5, 2007
  4. Victor Bazarov

    Re: constexpr static member function

    Victor Bazarov, Mar 1, 2013, in forum: C++
    Replies:
    1
    Views:
    241
    Victor Bazarov
    Mar 2, 2013
  5. Luca Risolia

    Re: constexpr static member function

    Luca Risolia, Mar 2, 2013, in forum: C++
    Replies:
    0
    Views:
    200
    Luca Risolia
    Mar 2, 2013
Loading...

Share This Page