From ae5718259a466d69faa5a90a4d7bed44a578615e Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 14 Nov 2018 11:37:53 -0800 Subject: [PATCH] P1032R1 Misc constexpr bits [tuple], [pairs.pair] Fixed relative order of 'explicit' and 'constexpr' Change 9: formatting and grammar fixes, replaced meaningless phrase "operations are constexpr" with intended "operations are implemented with constexpr functions" after consultation with LWG. Change 10: green line editing instruction ignored, there do not appear to be any other places that need changes. Fixes #2417 --- source/containers.tex | 16 ++-- source/iterators.tex | 93 ++++++++++++----------- source/strings.tex | 28 +++---- source/support.tex | 3 + source/utilities.tex | 170 +++++++++++++++++++++++------------------- 5 files changed, 167 insertions(+), 143 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 915171dd38..05ba5fc2c5 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -463,6 +463,10 @@ for some types of containers but not others. Those containers for which the listed operations are provided shall implement the semantics described in \tref{containers.optional.operations} unless otherwise stated. +If the iterators passed to \tcode{lexicographical_compare} +satisfy the constexpr iterator requirements\iref{iterator.requirements.general} +then the operations described in \tref{containers.optional.operations} +are implemented by constexpr functions. \begin{libreqtab5} {Optional container operations} @@ -3009,7 +3013,7 @@ template constexpr bool operator>=(const array& x, const array& y); template - void swap(array& x, array& y) noexcept(noexcept(x.swap(y))); + constexpr void swap(array& x, array& y) noexcept(noexcept(x.swap(y))); template class tuple_size; template class tuple_element; @@ -3235,8 +3239,8 @@ // no explicit construct/copy/destroy for aggregate type - void fill(const T& u); - void swap(array&) noexcept(is_nothrow_swappable_v); + constexpr void fill(const T& u); + constexpr void swap(array&) noexcept(is_nothrow_swappable_v); // iterators constexpr iterator begin() noexcept; @@ -3326,7 +3330,7 @@ \indexlibrarymember{array}{fill}% \begin{itemdecl} -void fill(const T& u); +constexpr void fill(const T& u); \end{itemdecl} \begin{itemdescr} @@ -3336,7 +3340,7 @@ \indexlibrarymember{array}{swap}% \begin{itemdecl} -void swap(array& y) noexcept(is_nothrow_swappable_v); +constexpr void swap(array& y) noexcept(is_nothrow_swappable_v); \end{itemdecl} \begin{itemdescr} @@ -3356,7 +3360,7 @@ \indexlibrarymember{array}{swap}% \begin{itemdecl} template - void swap(array& x, array& y) noexcept(noexcept(x.swap(y))); + constexpr void swap(array& x, array& y) noexcept(noexcept(x.swap(y))); \end{itemdecl} \begin{itemdescr} diff --git a/source/iterators.tex b/source/iterators.tex index 866cb952aa..1cec9fae6f 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -768,15 +768,16 @@ template class back_insert_iterator; template - back_insert_iterator back_inserter(Container& x); + constexpr back_insert_iterator back_inserter(Container& x); template class front_insert_iterator; template - front_insert_iterator front_inserter(Container& x); + constexpr front_insert_iterator front_inserter(Container& x); template class insert_iterator; template - insert_iterator inserter(Container& x, typename Container::iterator i); + constexpr insert_iterator + inserter(Container& x, typename Container::iterator i); template class move_iterator; template @@ -1704,17 +1705,17 @@ using reference = void; using container_type = Container; - explicit back_insert_iterator(Container& x); - back_insert_iterator& operator=(const typename Container::value_type& value); - back_insert_iterator& operator=(typename Container::value_type&& value); + constexpr explicit back_insert_iterator(Container& x); + constexpr back_insert_iterator& operator=(const typename Container::value_type& value); + constexpr back_insert_iterator& operator=(typename Container::value_type&& value); - back_insert_iterator& operator*(); - back_insert_iterator& operator++(); - back_insert_iterator operator++(int); + constexpr back_insert_iterator& operator*(); + constexpr back_insert_iterator& operator++(); + constexpr back_insert_iterator operator++(int); }; template - back_insert_iterator back_inserter(Container& x); + constexpr back_insert_iterator back_inserter(Container& x); } \end{codeblock} @@ -1722,7 +1723,7 @@ \indexlibrary{\idxcode{back_insert_iterator}!constructor}% \begin{itemdecl} -explicit back_insert_iterator(Container& x); +constexpr explicit back_insert_iterator(Container& x); \end{itemdecl} \begin{itemdescr} @@ -1735,7 +1736,7 @@ \indexlibrarymember{operator=}{back_insert_iterator}% \begin{itemdecl} -back_insert_iterator& operator=(const typename Container::value_type& value); +constexpr back_insert_iterator& operator=(const typename Container::value_type& value); \end{itemdecl} \begin{itemdescr} @@ -1750,7 +1751,7 @@ \indexlibrarymember{operator=}{back_insert_iterator}% \begin{itemdecl} -back_insert_iterator& operator=(typename Container::value_type&& value); +constexpr back_insert_iterator& operator=(typename Container::value_type&& value); \end{itemdecl} \begin{itemdescr} @@ -1765,7 +1766,7 @@ \indexlibrarymember{operator*}{back_insert_iterator}% \begin{itemdecl} -back_insert_iterator& operator*(); +constexpr back_insert_iterator& operator*(); \end{itemdecl} \begin{itemdescr} @@ -1776,8 +1777,8 @@ \indexlibrarymember{operator++}{back_insert_iterator}% \begin{itemdecl} -back_insert_iterator& operator++(); -back_insert_iterator operator++(int); +constexpr back_insert_iterator& operator++(); +constexpr back_insert_iterator operator++(int); \end{itemdecl} \begin{itemdescr} @@ -1791,7 +1792,7 @@ \indexlibrary{\idxcode{back_inserter}}% \begin{itemdecl} template - back_insert_iterator back_inserter(Container& x); + constexpr back_insert_iterator back_inserter(Container& x); \end{itemdecl} \begin{itemdescr} @@ -1818,17 +1819,17 @@ using reference = void; using container_type = Container; - explicit front_insert_iterator(Container& x); - front_insert_iterator& operator=(const typename Container::value_type& value); - front_insert_iterator& operator=(typename Container::value_type&& value); + constexpr explicit front_insert_iterator(Container& x); + constexpr front_insert_iterator& operator=(const typename Container::value_type& value); + constexpr front_insert_iterator& operator=(typename Container::value_type&& value); - front_insert_iterator& operator*(); - front_insert_iterator& operator++(); - front_insert_iterator operator++(int); + constexpr front_insert_iterator& operator*(); + constexpr front_insert_iterator& operator++(); + constexpr front_insert_iterator operator++(int); }; template - front_insert_iterator front_inserter(Container& x); + constexpr front_insert_iterator front_inserter(Container& x); } \end{codeblock} @@ -1836,7 +1837,7 @@ \indexlibrary{\idxcode{front_insert_iterator}!constructor}% \begin{itemdecl} -explicit front_insert_iterator(Container& x); +constexpr explicit front_insert_iterator(Container& x); \end{itemdecl} \begin{itemdescr} @@ -1849,7 +1850,7 @@ \indexlibrarymember{operator=}{front_insert_iterator}% \begin{itemdecl} -front_insert_iterator& operator=(const typename Container::value_type& value); +constexpr front_insert_iterator& operator=(const typename Container::value_type& value); \end{itemdecl} \begin{itemdescr} @@ -1864,7 +1865,7 @@ \indexlibrarymember{operator=}{front_insert_iterator}% \begin{itemdecl} -front_insert_iterator& operator=(typename Container::value_type&& value); +constexpr front_insert_iterator& operator=(typename Container::value_type&& value); \end{itemdecl} \begin{itemdescr} @@ -1879,7 +1880,7 @@ \indexlibrarymember{operator*}{front_insert_iterator}% \begin{itemdecl} -front_insert_iterator& operator*(); +constexpr front_insert_iterator& operator*(); \end{itemdecl} \begin{itemdescr} @@ -1890,8 +1891,8 @@ \indexlibrarymember{operator++}{front_insert_iterator}% \begin{itemdecl} -front_insert_iterator& operator++(); -front_insert_iterator operator++(int); +constexpr front_insert_iterator& operator++(); +constexpr front_insert_iterator operator++(int); \end{itemdecl} \begin{itemdescr} @@ -1905,7 +1906,7 @@ \indexlibrary{\idxcode{front_inserter}}% \begin{itemdecl} template - front_insert_iterator front_inserter(Container& x); + constexpr front_insert_iterator front_inserter(Container& x); \end{itemdecl} \begin{itemdescr} @@ -1933,17 +1934,18 @@ using reference = void; using container_type = Container; - insert_iterator(Container& x, typename Container::iterator i); - insert_iterator& operator=(const typename Container::value_type& value); - insert_iterator& operator=(typename Container::value_type&& value); + constexpr insert_iterator(Container& x, typename Container::iterator i); + constexpr insert_iterator& operator=(const typename Container::value_type& value); + constexpr insert_iterator& operator=(typename Container::value_type&& value); - insert_iterator& operator*(); - insert_iterator& operator++(); - insert_iterator& operator++(int); + constexpr insert_iterator& operator*(); + constexpr insert_iterator& operator++(); + constexpr insert_iterator& operator++(int); }; template - insert_iterator inserter(Container& x, typename Container::iterator i); + constexpr insert_iterator + inserter(Container& x, typename Container::iterator i); } \end{codeblock} @@ -1951,7 +1953,7 @@ \indexlibrary{\idxcode{insert_iterator}!constructor}% \begin{itemdecl} -insert_iterator(Container& x, typename Container::iterator i); +constexpr insert_iterator(Container& x, typename Container::iterator i); \end{itemdecl} \begin{itemdescr} @@ -1966,7 +1968,7 @@ \indexlibrarymember{operator=}{insert_iterator}% \begin{itemdecl} -insert_iterator& operator=(const typename Container::value_type& value); +constexpr insert_iterator& operator=(const typename Container::value_type& value); \end{itemdecl} \begin{itemdescr} @@ -1985,7 +1987,7 @@ \indexlibrarymember{operator=}{insert_iterator}% \begin{itemdecl} -insert_iterator& operator=(typename Container::value_type&& value); +constexpr insert_iterator& operator=(typename Container::value_type&& value); \end{itemdecl} \begin{itemdescr} @@ -2004,7 +2006,7 @@ \indexlibrarymember{operator*}{insert_iterator}% \begin{itemdecl} -insert_iterator& operator*(); +constexpr insert_iterator& operator*(); \end{itemdecl} \begin{itemdescr} @@ -2015,8 +2017,8 @@ \indexlibrarymember{operator++}{insert_iterator}% \begin{itemdecl} -insert_iterator& operator++(); -insert_iterator& operator++(int); +constexpr insert_iterator& operator++(); +constexpr insert_iterator& operator++(int); \end{itemdecl} \begin{itemdescr} @@ -2030,7 +2032,8 @@ \indexlibrary{\idxcode{inserter}}% \begin{itemdecl} template - insert_iterator inserter(Container& x, typename Container::iterator i); + constexpr insert_iterator + inserter(Container& x, typename Container::iterator i); \end{itemdecl} \begin{itemdescr} diff --git a/source/strings.tex b/source/strings.tex index 6f8494cb79..2f7ba9fef4 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -333,9 +333,9 @@ static constexpr size_t length(const char_type* s); static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a); - static char_type* move(char_type* s1, const char_type* s2, size_t n); - static char_type* copy(char_type* s1, const char_type* s2, size_t n); - static char_type* assign(char_type* s, size_t n, char_type a); + static constexpr char_type* move(char_type* s1, const char_type* s2, size_t n); + static constexpr char_type* copy(char_type* s1, const char_type* s2, size_t n); + static constexpr char_type* assign(char_type* s, size_t n, char_type a); static constexpr int_type not_eof(int_type c) noexcept; static constexpr char_type to_char_type(int_type c) noexcept; @@ -457,9 +457,9 @@ static constexpr size_t length(const char_type* s); static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a); - static char_type* move(char_type* s1, const char_type* s2, size_t n); - static char_type* copy(char_type* s1, const char_type* s2, size_t n); - static char_type* assign(char_type* s, size_t n, char_type a); + static constexpr char_type* move(char_type* s1, const char_type* s2, size_t n); + static constexpr char_type* copy(char_type* s1, const char_type* s2, size_t n); + static constexpr char_type* assign(char_type* s, size_t n, char_type a); static constexpr int_type not_eof(int_type c) noexcept; static constexpr char_type to_char_type(int_type c) noexcept; @@ -507,9 +507,9 @@ static constexpr size_t length(const char_type* s); static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a); - static char_type* move(char_type* s1, const char_type* s2, size_t n); - static char_type* copy(char_type* s1, const char_type* s2, size_t n); - static char_type* assign(char_type* s, size_t n, char_type a); + static constexpr char_type* move(char_type* s1, const char_type* s2, size_t n); + static constexpr char_type* copy(char_type* s1, const char_type* s2, size_t n); + static constexpr char_type* assign(char_type* s, size_t n, char_type a); static constexpr int_type not_eof(int_type c) noexcept; static constexpr char_type to_char_type(int_type c) noexcept; @@ -557,9 +557,9 @@ static constexpr size_t length(const char_type* s); static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a); - static char_type* move(char_type* s1, const char_type* s2, size_t n); - static char_type* copy(char_type* s1, const char_type* s2, size_t n); - static char_type* assign(char_type* s, size_t n, char_type a); + static constexpr char_type* move(char_type* s1, const char_type* s2, size_t n); + static constexpr char_type* copy(char_type* s1, const char_type* s2, size_t n); + static constexpr char_type* assign(char_type* s, size_t n, char_type a); static constexpr int_type not_eof(int_type c) noexcept; static constexpr char_type to_char_type(int_type c) noexcept; @@ -4997,7 +4997,7 @@ constexpr void swap(basic_string_view& s) noexcept; // \ref{string.view.ops}, string operations - size_type copy(charT* s, size_type n, size_type pos = 0) const; + constexpr size_type copy(charT* s, size_type n, size_type pos = 0) const; constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const; @@ -5392,7 +5392,7 @@ \indexlibrarymember{copy}{basic_string_view}% \begin{itemdecl} -size_type copy(charT* s, size_type n, size_type pos = 0) const; +constexpr size_type copy(charT* s, size_type n, size_type pos = 0) const; \end{itemdecl} \begin{itemdescr} diff --git a/source/support.tex b/source/support.tex index b1c0e73edc..e0c364f0b7 100644 --- a/source/support.tex +++ b/source/support.tex @@ -575,6 +575,9 @@ \tcode{} \\ \rowsep \defnlibxname{cpp_lib_concepts} & \tcode{201806L} & \tcode{} \\ \rowsep +\defnlibxname{cpp_lib_constexpr_misc} & \tcode{201811L} & + \tcode{} \tcode{} \tcode{} + \tcode{} \tcode{} \tcode{} \\ \rowsep \defnlibxname{cpp_lib_constexpr_swap_algorithms} & \tcode{201806L} & \tcode{} \\ \rowsep \defnlibxname{cpp_lib_destroying_delete} & \tcode{201806L} & diff --git a/source/utilities.tex b/source/utilities.tex index 586205cf45..c64bb736ce 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -114,7 +114,7 @@ constexpr bool operator>=(const pair&, const pair&); template - void swap(pair& x, pair& y) noexcept(noexcept(x.swap(y))); + constexpr void swap(pair& x, pair& y) noexcept(noexcept(x.swap(y))); template constexpr @\seebelow@ make_pair(T1&&, T2&&); @@ -479,25 +479,26 @@ pair(const pair&) = default; pair(pair&&) = default; - explicit(@\seebelow@) constexpr pair(); - explicit(@\seebelow@) constexpr pair(const T1& x, const T2& y); + constexpr explicit(@\seebelow@) pair(); + constexpr explicit(@\seebelow@) pair(const T1& x, const T2& y); template - explicit(@\seebelow@) constexpr pair(U1&& x, U2&& y); + constexpr explicit(@\seebelow@) pair(U1&& x, U2&& y); template - explicit(@\seebelow@) constexpr pair(const pair& p); + constexpr explicit(@\seebelow@) pair(const pair& p); template - explicit(@\seebelow@) constexpr pair(pair&& p); + constexpr explicit(@\seebelow@) pair(pair&& p); template - pair(piecewise_construct_t, tuple first_args, tuple second_args); + constexpr pair(piecewise_construct_t, + tuple first_args, tuple second_args); - pair& operator=(const pair& p); + constexpr pair& operator=(const pair& p); template - pair& operator=(const pair& p); - pair& operator=(pair&& p) noexcept(@\seebelow@); + constexpr pair& operator=(const pair& p); + constexpr pair& operator=(pair&& p) noexcept(@\seebelow@); template - pair& operator=(pair&& p); + constexpr pair& operator=(pair&& p); - void swap(pair& p) noexcept(@\seebelow@); + constexpr void swap(pair& p) noexcept(@\seebelow@); }; template @@ -522,7 +523,7 @@ \indexlibrary{\idxcode{pair}!constructor}% \begin{itemdecl} -explicit(@\seebelow@) constexpr pair(); +constexpr explicit(@\seebelow@) pair(); \end{itemdecl} \begin{itemdescr} @@ -547,7 +548,7 @@ \indexlibrary{\idxcode{pair}!constructor}% \begin{itemdecl} -explicit(@\seebelow@) constexpr pair(const T1& x, const T2& y); +constexpr explicit(@\seebelow@) pair(const T1& x, const T2& y); \end{itemdecl} \begin{itemdescr} @@ -568,7 +569,7 @@ \indexlibrary{\idxcode{pair}!constructor}% \begin{itemdecl} -template explicit(@\seebelow@) constexpr pair(U1&& x, U2&& y); +template constexpr explicit(@\seebelow@) pair(U1&& x, U2&& y); \end{itemdecl} \begin{itemdescr} @@ -591,7 +592,7 @@ \indexlibrary{\idxcode{pair}!constructor}% \begin{itemdecl} -template explicit(@\seebelow@) constexpr pair(const pair& p); +template constexpr explicit(@\seebelow@) pair(const pair& p); \end{itemdecl} \begin{itemdescr} @@ -611,7 +612,7 @@ \indexlibrary{\idxcode{pair}!constructor}% \begin{itemdecl} -template explicit(@\seebelow@) constexpr pair(pair&& p); +template constexpr explicit(@\seebelow@) pair(pair&& p); \end{itemdecl} \begin{itemdescr} @@ -635,7 +636,8 @@ \indexlibrary{\idxcode{pair}!constructor}% \begin{itemdecl} template - pair(piecewise_construct_t, tuple first_args, tuple second_args); + constexpr pair(piecewise_construct_t, + tuple first_args, tuple second_args); \end{itemdecl} \begin{itemdescr} @@ -656,7 +658,7 @@ \indexlibrarymember{operator=}{pair}% \begin{itemdecl} -pair& operator=(const pair& p); +constexpr pair& operator=(const pair& p); \end{itemdecl} \begin{itemdescr} @@ -674,7 +676,7 @@ \indexlibrarymember{operator=}{pair}% \begin{itemdecl} -template pair& operator=(const pair& p); +template constexpr pair& operator=(const pair& p); \end{itemdecl} \begin{itemdescr} @@ -692,7 +694,7 @@ \indexlibrarymember{operator=}{pair}% \begin{itemdecl} -pair& operator=(pair&& p) noexcept(@\seebelow@); +constexpr pair& operator=(pair&& p) noexcept(@\seebelow@); \end{itemdecl} \begin{itemdescr} @@ -718,7 +720,7 @@ \indexlibrarymember{operator=}{pair}% \begin{itemdecl} -template pair& operator=(pair&& p); +template constexpr pair& operator=(pair&& p); \end{itemdecl} \begin{itemdescr} @@ -738,7 +740,7 @@ \indexlibrarymember{swap}{pair}% \begin{itemdecl} -void swap(pair& p) noexcept(@\seebelow@); +constexpr void swap(pair& p) noexcept(@\seebelow@); \end{itemdecl} \begin{itemdescr} @@ -833,7 +835,7 @@ \indexlibrary{\idxcode{swap}!\idxcode{pair}}% \begin{itemdecl} template - void swap(pair& x, pair& y) noexcept(noexcept(x.swap(y))); + constexpr void swap(pair& x, pair& y) noexcept(noexcept(x.swap(y))); \end{itemdecl} \begin{itemdescr} @@ -1072,7 +1074,7 @@ // \ref{tuple.special}, specialized algorithms template - void swap(tuple& x, tuple& y) noexcept(@\seebelow@); + constexpr void swap(tuple& x, tuple& y) noexcept(@\seebelow@); // \ref{tuple.helper}, tuple helper classes template @@ -1089,60 +1091,66 @@ class tuple { public: // \ref{tuple.cnstr}, \tcode{tuple} construction - explicit(@\seebelow@) constexpr tuple(); - explicit(@\seebelow@) constexpr tuple(const Types&...); // only if \tcode{sizeof...(Types) >= 1} + constexpr explicit(@\seebelow@) tuple(); + constexpr explicit(@\seebelow@) tuple(const Types&...); // only if \tcode{sizeof...(Types) >= 1} template - explicit(@\seebelow@) constexpr tuple(UTypes&&...); // only if \tcode{sizeof...(Types) >= 1} + constexpr explicit(@\seebelow@) tuple(UTypes&&...); // only if \tcode{sizeof...(Types) >= 1} tuple(const tuple&) = default; tuple(tuple&&) = default; template - explicit(@\seebelow@) constexpr tuple(const tuple&); + constexpr explicit(@\seebelow@) tuple(const tuple&); template - explicit(@\seebelow@) constexpr tuple(tuple&&); + constexpr explicit(@\seebelow@) tuple(tuple&&); template - explicit(@\seebelow@) constexpr tuple(const pair&); // only if \tcode{sizeof...(Types) == 2} + constexpr explicit(@\seebelow@) tuple(const pair&); // only if \tcode{sizeof...(Types) == 2} template - explicit(@\seebelow@) constexpr tuple(pair&&); // only if \tcode{sizeof...(Types) == 2} + constexpr explicit(@\seebelow@) tuple(pair&&); // only if \tcode{sizeof...(Types) == 2} // allocator-extended constructors template - tuple(allocator_arg_t, const Alloc& a); + constexpr tuple(allocator_arg_t, const Alloc& a); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, const Types&...); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, const Types&...); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, UTypes&&...); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, UTypes&&...); template - tuple(allocator_arg_t, const Alloc& a, const tuple&); + constexpr tuple(allocator_arg_t, const Alloc& a, const tuple&); template - tuple(allocator_arg_t, const Alloc& a, tuple&&); + constexpr tuple(allocator_arg_t, const Alloc& a, tuple&&); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, const tuple&); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, const tuple&); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, tuple&&); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, tuple&&); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, const pair&); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, const pair&); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, pair&&); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, pair&&); // \ref{tuple.assign}, \tcode{tuple} assignment - tuple& operator=(const tuple&); - tuple& operator=(tuple&&) noexcept(@\seebelow@); + constexpr tuple& operator=(const tuple&); + constexpr tuple& operator=(tuple&&) noexcept(@\seebelow@); template - tuple& operator=(const tuple&); + constexpr tuple& operator=(const tuple&); template - tuple& operator=(tuple&&); + constexpr tuple& operator=(tuple&&); template - tuple& operator=(const pair&); // only if \tcode{sizeof...(Types) == 2} + constexpr tuple& operator=(const pair&); // only if \tcode{sizeof...(Types) == 2} template - tuple& operator=(pair&&); // only if \tcode{sizeof...(Types) == 2} + constexpr tuple& operator=(pair&&); // only if \tcode{sizeof...(Types) == 2} // \ref{tuple.swap}, \tcode{tuple} swap - void swap(tuple&) noexcept(@\seebelow@); + constexpr void swap(tuple&) noexcept(@\seebelow@); }; template @@ -1185,7 +1193,7 @@ \indexlibrary{\idxcode{tuple}!constructor}% \begin{itemdecl} -explicit(@\seebelow@) constexpr tuple(); +constexpr explicit(@\seebelow@) tuple(); \end{itemdecl} \begin{itemdescr} @@ -1207,7 +1215,7 @@ \indexlibrary{\idxcode{tuple}!constructor}% \begin{itemdecl} -explicit(@\seebelow@) constexpr tuple(const Types&...); +constexpr explicit(@\seebelow@) tuple(const Types&...); \end{itemdecl} \begin{itemdescr} @@ -1227,7 +1235,7 @@ \indexlibrary{\idxcode{tuple}!constructor}% \begin{itemdecl} -template explicit(@\seebelow@) constexpr tuple(UTypes&&... u); +template constexpr explicit(@\seebelow@) tuple(UTypes&&... u); \end{itemdecl} \begin{itemdescr} @@ -1276,7 +1284,7 @@ \indexlibrary{\idxcode{tuple}!constructor}% \begin{itemdecl} -template explicit(@\seebelow@) constexpr tuple(const tuple& u); +template constexpr explicit(@\seebelow@) tuple(const tuple& u); \end{itemdecl} \begin{itemdescr} @@ -1305,7 +1313,7 @@ \indexlibrary{\idxcode{tuple}!constructor}% \begin{itemdecl} -template explicit(@\seebelow@) constexpr tuple(tuple&& u); +template constexpr explicit(@\seebelow@) tuple(tuple&& u); \end{itemdecl} \begin{itemdescr} @@ -1338,7 +1346,7 @@ \indexlibrary{\idxcode{tuple}!constructor}% \indexlibrary{\idxcode{pair}}% \begin{itemdecl} -template explicit(@\seebelow@) constexpr tuple(const pair& u); +template constexpr explicit(@\seebelow@) tuple(const pair& u); \end{itemdecl} \begin{itemdescr} @@ -1362,7 +1370,7 @@ \indexlibrary{\idxcode{tuple}!constructor}% \indexlibrary{\idxcode{pair}}% \begin{itemdecl} -template explicit(@\seebelow@) constexpr tuple(pair&& u); +template constexpr explicit(@\seebelow@) tuple(pair&& u); \end{itemdecl} \begin{itemdescr} @@ -1387,23 +1395,29 @@ \indexlibrary{\idxcode{tuple}!constructor}% \begin{itemdecl} template - tuple(allocator_arg_t, const Alloc& a); + constexpr tuple(allocator_arg_t, const Alloc& a); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, const Types&...); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, const Types&...); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, UTypes&&...); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, UTypes&&...); template - tuple(allocator_arg_t, const Alloc& a, const tuple&); + constexpr tuple(allocator_arg_t, const Alloc& a, const tuple&); template - tuple(allocator_arg_t, const Alloc& a, tuple&&); + constexpr tuple(allocator_arg_t, const Alloc& a, tuple&&); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, const tuple&); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, const tuple&); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, tuple&&); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, tuple&&); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, const pair&); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, const pair&); template - explicit(@\seebelow@) tuple(allocator_arg_t, const Alloc& a, pair&&); + constexpr explicit(@\seebelow@) + tuple(allocator_arg_t, const Alloc& a, pair&&); \end{itemdecl} \begin{itemdescr} @@ -1428,7 +1442,7 @@ \indexlibrarymember{operator=}{tuple}% \begin{itemdecl} -tuple& operator=(const tuple& u); +constexpr tuple& operator=(const tuple& u); \end{itemdecl} \begin{itemdescr} @@ -1446,7 +1460,7 @@ \indexlibrarymember{operator=}{tuple}% \begin{itemdecl} -tuple& operator=(tuple&& u) noexcept(@\seebelow@); +constexpr tuple& operator=(tuple&& u) noexcept(@\seebelow@); \end{itemdecl} \begin{itemdescr} @@ -1473,7 +1487,7 @@ \indexlibrarymember{operator=}{tuple}% \begin{itemdecl} -template tuple& operator=(const tuple& u); +template constexpr tuple& operator=(const tuple& u); \end{itemdecl} \begin{itemdescr} @@ -1492,7 +1506,7 @@ \indexlibrarymember{operator=}{tuple}% \begin{itemdecl} -template tuple& operator=(tuple&& u); +template constexpr tuple& operator=(tuple&& u); \end{itemdecl} \begin{itemdescr} @@ -1512,7 +1526,7 @@ \indexlibrarymember{operator=}{tuple}% \indexlibrary{\idxcode{pair}}% \begin{itemdecl} -template tuple& operator=(const pair& u); +template constexpr tuple& operator=(const pair& u); \end{itemdecl} \begin{itemdescr} @@ -1534,7 +1548,7 @@ \indexlibrarymember{operator=}{tuple}% \indexlibrary{\idxcode{pair}}% \begin{itemdecl} -template tuple& operator=(pair&& u); +template constexpr tuple& operator=(pair&& u); \end{itemdecl} \begin{itemdescr} @@ -1559,7 +1573,7 @@ \indexlibrarymember{swap}{tuple}% \begin{itemdecl} -void swap(tuple& rhs) noexcept(@\seebelow@); +constexpr void swap(tuple& rhs) noexcept(@\seebelow@); \end{itemdecl} \begin{itemdescr} @@ -2085,7 +2099,7 @@ \indexlibrary{\idxcode{swap}}% \begin{itemdecl} template - void swap(tuple& x, tuple& y) noexcept(@\seebelow@); + constexpr void swap(tuple& x, tuple& y) noexcept(@\seebelow@); \end{itemdecl} \begin{itemdescr} @@ -15056,11 +15070,11 @@ template> class default_searcher { public: - default_searcher(ForwardIterator1 pat_first, ForwardIterator1 pat_last, - BinaryPredicate pred = BinaryPredicate()); + constexpr default_searcher(ForwardIterator1 pat_first, ForwardIterator1 pat_last, + BinaryPredicate pred = BinaryPredicate()); template - pair + constexpr pair operator()(ForwardIterator2 first, ForwardIterator2 last) const; private: @@ -15072,8 +15086,8 @@ \indexlibrary{\idxcode{default_searcher}!constructor}% \begin{itemdecl} -default_searcher(ForwardIterator pat_first, ForwardIterator pat_last, - BinaryPredicate pred = BinaryPredicate()); +constexpr default_searcher(ForwardIterator pat_first, ForwardIterator pat_last, + BinaryPredicate pred = BinaryPredicate()); \end{itemdecl} \begin{itemdescr} @@ -15093,7 +15107,7 @@ \indexlibrarymember{operator()}{default_searcher}% \begin{itemdecl} template - pair + constexpr pair operator()(ForwardIterator2 first, ForwardIterator2 last) const; \end{itemdecl}