diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-02 01:31:50 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-02 01:31:50 +0000 |
commit | 1e0572d7d35696dcf132f429da89fc58f4621c67 (patch) | |
tree | a81889fc318d20d599750c915656f1365ed5f443 /libstdc++-v3/libsupc++ | |
parent | 0a32318d804bdd3fb4c2a4cd3730840734c6994a (diff) | |
download | gcc-1e0572d7d35696dcf132f429da89fc58f4621c67.tar.gz |
* libsupc++/initializer_list: Decorate with constexpr.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166170 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r-- | libstdc++-v3/libsupc++/initializer_list | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libstdc++-v3/libsupc++/initializer_list b/libstdc++-v3/libsupc++/initializer_list index 0006b70f40a..1048d44de07 100644 --- a/libstdc++-v3/libsupc++/initializer_list +++ b/libstdc++-v3/libsupc++/initializer_list @@ -57,23 +57,23 @@ namespace std size_type _M_len; // The compiler can call a private constructor. - initializer_list(const_iterator __a, size_type __l) + constexpr initializer_list(const_iterator __a, size_type __l) : _M_array(__a), _M_len(__l) { } public: - initializer_list() : _M_array(0), _M_len(0) { } + constexpr initializer_list() : _M_array(0), _M_len(0) { } // Number of elements. - size_type - size() const { return _M_len; } + constexpr size_type + size() { return _M_len; } // First element. - const_iterator - begin() const { return _M_array; } + constexpr const_iterator + begin() { return _M_array; } // One past the last element. - const_iterator - end() const { return begin() + size(); } + constexpr const_iterator + end() { return begin() + size(); } }; /** @@ -82,7 +82,7 @@ namespace std * @param il Initializer list. */ template<class _Tp> - inline const _Tp* + constexpr const _Tp* begin(initializer_list<_Tp> __ils) { return __ils.begin(); } @@ -92,7 +92,7 @@ namespace std * @param il Initializer list. */ template<class _Tp> - inline const _Tp* + constexpr const _Tp* end(initializer_list<_Tp> __ils) { return __ils.end(); } } |