[Boost-bugs] [Boost C++ Libraries] #12273: boost::container::static_vector max_size() and capacity() should be constant expressions

Subject: [Boost-bugs] [Boost C++ Libraries] #12273: boost::container::static_vector max_size() and capacity() should be constant expressions
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-06-16 19:58:42


#12273: boost::container::static_vector max_size() and capacity() should be
constant expressions
------------------------------+--------------------------
 Reporter: jim.king@… | Owner: igaztanaga
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: container
  Version: Boost 1.61.0 | Severity: Optimization
 Keywords: |
------------------------------+--------------------------
 The capacity of a static_vector is a compile time constant.
 One should be able to retrieve the capacity at compile time as a constant
 expression. In the current implementation, one must execute a runtime
 method of either capacity() or max_size() to obtain the capacity. There
 are use cases where one would want to create another container that has
 the same capacity as the static_vector will have, so to improve ease of
 use I would propose adding:

     BOOST_STATIC_CONSTANT(size_type, capacity = Capacity)
     BOOST_STATIC_CONSTANT(size_type, max_size = Capacity)

 following the set of typedefs in the class.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12273>
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:20 UTC