Re: [Boost-bugs] [Boost C++ Libraries] #4146: [patch] ./boost/property_tree/detail/xml_parser_read_rapidxml.hpp:117: error: non-constant `(((int)f_c) | 3072)' cannot be used as template argument

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4146: [patch] ./boost/property_tree/detail/xml_parser_read_rapidxml.hpp:117: error: non-constant `(((int)f_c) | 3072)' cannot be used as template argument
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-21 19:53:16


#4146: [patch] ./boost/property_tree/detail/xml_parser_read_rapidxml.hpp:117:
error: non-constant `(((int)f_c) | 3072)' cannot be used as template
argument
---------------------------------------------------+------------------------
  Reporter: Jan-Hein Bührman <buhrman@…> | Owner: cornedbee
      Type: Bugs | Status: closed
 Milestone: | Component: property_tree
   Version: Boost Development Trunk | Severity: Showstopper
Resolution: fixed | Keywords: property_tree xml_parser non-constant template argument
---------------------------------------------------+------------------------

Comment (by buhrman@…):

 Replying to [comment:8 Leonid Gershanovich <gleonid@…>]:
> I am using boost '''1.46.1'''.
>
> Those gcc versions are chocking on "const int" used as template
 argument, since "const int" is not a compile time constant in a strict
 sense.
 Stroustrup, ''The C++ Programming Language'', 3rd ed., 3rd printing, sect.
 13.2.3, ''Template Parameters'', states:
   A template argument can be a constant expression (sect. C.5).
 And sect. C.5, ''Constant Expressions'', states:
   A constant expression evaluates to an integral or enumeration constant.
 Such an
   expression is composed of literals [...], enumerators [...], and
 ''const''s initialized
   by constant expressions.
 I didn't check the official standard, but I guess, reading the above, any
 decent compiler should grok this.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4146#comment:9>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC