mirror of
https://github.com/boostorg/array.git
synced 2025-06-26 12:31:41 +02:00
Compare commits
20 Commits
svn-branch
...
boost-1.43
Author | SHA1 | Date | |
---|---|---|---|
73af273f9d | |||
0c8902e8c2 | |||
88868ba0df | |||
99631823f6 | |||
5661b8cd63 | |||
86b069ad0e | |||
3d20bb1310 | |||
e7122b3f20 | |||
4dd2cf1b64 | |||
2e88dc228d | |||
0a4d7e81ef | |||
96d4c5f737 | |||
5a23b06a83 | |||
e85feee293 | |||
b6522b3f60 | |||
3044ab376c | |||
69188c998f | |||
4c5212f5e4 | |||
276cd991f3 | |||
1f8298fb08 |
@ -14,8 +14,8 @@
|
|||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
* http://www.boost.org/LICENSE_1_0.txt)
|
||||||
*
|
*
|
||||||
* 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group.
|
* 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group.
|
||||||
* See <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776> or Trac issue #3168
|
* See <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776> or Trac issue #3168
|
||||||
* Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow)
|
* Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow)
|
||||||
* 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow)
|
* 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow)
|
||||||
* 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis)
|
* 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis)
|
||||||
* 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
|
* 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
|
||||||
@ -169,7 +169,7 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// assign one value to all elements
|
// assign one value to all elements
|
||||||
void assign (const T& value) { fill ( value ); } // A synonym for fill
|
void assign (const T& value) { fill ( value ); } // A synonym for fill
|
||||||
void fill (const T& value)
|
void fill (const T& value)
|
||||||
{
|
{
|
||||||
std::fill_n(begin(),size(),value);
|
std::fill_n(begin(),size(),value);
|
||||||
@ -295,8 +295,8 @@ namespace boost {
|
|||||||
|
|
||||||
// assign one value to all elements
|
// assign one value to all elements
|
||||||
void assign (const T& value) { fill ( value ); }
|
void assign (const T& value) { fill ( value ); }
|
||||||
void fill (const T& ) {}
|
void fill (const T& ) {}
|
||||||
|
|
||||||
// check range (may be private because it is static)
|
// check range (may be private because it is static)
|
||||||
static reference failed_rangecheck () {
|
static reference failed_rangecheck () {
|
||||||
std::out_of_range e("attempt to access element of an empty array");
|
std::out_of_range e("attempt to access element of an empty array");
|
||||||
@ -346,38 +346,6 @@ namespace boost {
|
|||||||
x.swap(y);
|
x.swap(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specific for boost::array: simply returns its elems data member.
|
|
||||||
template <typename T, std::size_t N>
|
|
||||||
T(&get_c_array(boost::array<T,N>& arg))[N]
|
|
||||||
{
|
|
||||||
return arg.elems;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Const version.
|
|
||||||
template <typename T, std::size_t N>
|
|
||||||
const T(&get_c_array(const boost::array<T,N>& arg))[N]
|
|
||||||
{
|
|
||||||
return arg.elems;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// Overload for std::array, assuming that std::array will have
|
|
||||||
// explicit conversion functions as discussed at the WG21 meeting
|
|
||||||
// in Summit, March 2009.
|
|
||||||
template <typename T, std::size_t N>
|
|
||||||
T(&get_c_array(std::array<T,N>& arg))[N]
|
|
||||||
{
|
|
||||||
return static_cast<T(&)[N]>(arg);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Const version.
|
|
||||||
template <typename T, std::size_t N>
|
|
||||||
const T(&get_c_array(const std::array<T,N>& arg))[N]
|
|
||||||
{
|
|
||||||
return static_cast<T(&)[N]>(arg);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} /* namespace boost */
|
} /* namespace boost */
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,11 +5,6 @@
|
|||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
* http://www.boost.org/LICENSE_1_0.txt)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SCL_SECURE_NO_WARNINGS
|
|
||||||
// Suppress warnings from the std lib:
|
|
||||||
# define _SCL_SECURE_NO_WARNINGS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <boost/array.hpp>
|
#include <boost/array.hpp>
|
||||||
|
Reference in New Issue
Block a user