[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#538647: closed by Florian Weimer <fw@deneb.enyo.de> (Re: Bug#538647: g++-4.3: g++ examines second value to "?" always if it is a template)




* Philip Ashmore:

  
/*HERE*/enum { value = (wanted <= guess) ? result : next_value_type::value };
    
Not a bug.  You need to implement your own conditional operator at the
template level to make this work.  The version with ?: is not valid
C++
Not valid C++ ? My C++ compiler (g++) disagrees.
Think of
    enum { big_int = (sizeof(int) > 4) ? true : false };
Have you tried compiling the example?

I don't remember reading anything about "conditional operator at the template level" in
Stroustrup's "C++ programming language (third edition).
Could you elaborate?

Philip

Reply to: