Re: [Boost-bugs] [Boost C++ Libraries] #7652: compile-time checked access

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7652: compile-time checked access
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-12-18 16:24:46


#7652: compile-time checked access
-------------------------------+--------------------------------------------
  Reporter: tobias.loew | Owner: marshall
      Type: Feature Requests | Status: new
 Milestone: To Be Determined | Component: array
   Version: Boost 1.52.0 | Severity: Optimization
Resolution: | Keywords:
-------------------------------+--------------------------------------------

Comment (by marshall):

 Yes, it would - but would people actually use it?

 Do people use:
 {{{
 std::array<int, 2> arr;
 std::get<2>(arr) = -1;
 }}}
 in C++11 - or do they just write `arr[2] = -1;` ?

 `boost::array` (and `std::array`, and `std::vector`) all have runtime
 checking through the member function `at`.
 {{{
 boost::array<int, 2> arr;
 arr.at(2) = -1; // will throw an exception
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7652#comment:1>
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:11 UTC