@@ -31,12 +31,6 @@ class er;
3131 */
3232namespace tuples {
3333
34- #if __cplusplus >= 201402L
35- #define TUPLES_LIB_CONSTEXPR_CXX_14 constexpr
36- #else
37- #define TUPLES_LIB_CONSTEXPR_CXX_14
38- #endif
39-
4034namespace tuples_detail {
4135
4236template <class T >
@@ -167,11 +161,7 @@ class TaggedTupleLeaf<Tag, false> {
167161 ~TaggedTupleLeaf () = default ;
168162
169163 // Note: name get_data instead of get to enable structured binding support.
170- #if __cplusplus < 201402L
171- value_type& get_data () { return value_; }
172- #else
173164 constexpr value_type& get_data () { return value_; }
174- #endif
175165 constexpr const value_type& get_data () const { return value_; }
176166
177167 bool swap (TaggedTupleLeaf& t) {
@@ -208,11 +198,7 @@ class TaggedTupleLeaf<Tag, true> : private Tag::type {
208198 ~TaggedTupleLeaf () = default ;
209199
210200 // Note: name get_data instead of get to enable structured binding support.
211- #if __cplusplus < 201402L
212- value_type& get_data () { return static_cast <value_type&>(*this ); }
213- #else
214201 constexpr value_type& get_data () { return static_cast <value_type&>(*this ); }
215- #endif
216202
217203 constexpr const value_type& get_data () const {
218204 return static_cast <const value_type&>(*this );
@@ -549,15 +535,14 @@ inline constexpr typename tmpl::at_c<tmpl::list<Tags...>, I>::type& get(
549535namespace tuples_detail {
550536struct equal {
551537 template <class T , class U >
552- static TUPLES_LIB_CONSTEXPR_CXX_14 void apply (T const & lhs, U const & rhs,
553- bool * result) {
538+ static constexpr void apply (T const & lhs, U const & rhs, bool * result) {
554539 *result = *result and lhs == rhs;
555540 }
556541};
557542
558543template <class ... LTags, class ... RTags>
559- TUPLES_LIB_CONSTEXPR_CXX_14 bool tuple_equal_impl (
560- TaggedTuple<LTags...> const & lhs, TaggedTuple<RTags...> const & rhs) {
544+ constexpr bool tuple_equal_impl (TaggedTuple<LTags...> const & lhs,
545+ TaggedTuple<RTags...> const & rhs) {
561546 bool equal = true ;
562547 // This short circuits in the sense that the operator== is only evaluated if
563548 // the result thus far is true
@@ -570,25 +555,24 @@ TUPLES_LIB_CONSTEXPR_CXX_14 bool tuple_equal_impl(
570555template <class ... LTags, class ... RTags,
571556 typename std::enable_if<sizeof ...(LTags) == sizeof ...(RTags)>::type* =
572557 nullptr >
573- TUPLES_LIB_CONSTEXPR_CXX_14 bool operator ==(TaggedTuple<LTags...> const & lhs,
574- TaggedTuple<RTags...> const & rhs) {
558+ constexpr bool operator ==(TaggedTuple<LTags...> const & lhs,
559+ TaggedTuple<RTags...> const & rhs) {
575560 return tuples_detail::tuple_equal_impl (lhs, rhs);
576561}
577562
578563template <class ... LTags, class ... RTags,
579564 typename std::enable_if<sizeof ...(LTags) == sizeof ...(RTags)>::type* =
580565 nullptr >
581- TUPLES_LIB_CONSTEXPR_CXX_14 bool operator !=(TaggedTuple<LTags...> const & lhs,
582- TaggedTuple<RTags...> const & rhs) {
566+ constexpr bool operator !=(TaggedTuple<LTags...> const & lhs,
567+ TaggedTuple<RTags...> const & rhs) {
583568 return not (lhs == rhs);
584569}
585570
586571namespace tuples_detail {
587572struct less {
588573 template <class T , class U >
589- static TUPLES_LIB_CONSTEXPR_CXX_14 void apply (T const & lhs, U const & rhs,
590- bool * last_rhs_less_lhs,
591- bool * result) {
574+ static constexpr void apply (T const & lhs, U const & rhs,
575+ bool * last_rhs_less_lhs, bool * result) {
592576 if (*result or *last_rhs_less_lhs) {
593577 return ;
594578 }
@@ -601,8 +585,8 @@ struct less {
601585};
602586
603587template <class ... LTags, class ... RTags>
604- TUPLES_LIB_CONSTEXPR_CXX_14 bool tuple_less_impl (
605- TaggedTuple<LTags...> const & lhs, TaggedTuple<RTags...> const & rhs) {
588+ constexpr bool tuple_less_impl (TaggedTuple<LTags...> const & lhs,
589+ TaggedTuple<RTags...> const & rhs) {
606590 bool result = false ;
607591 bool last_rhs_less_lhs = false ;
608592 static_cast <void >(
@@ -616,32 +600,32 @@ TUPLES_LIB_CONSTEXPR_CXX_14 bool tuple_less_impl(
616600template <class ... LTags, class ... RTags,
617601 typename std::enable_if<sizeof ...(LTags) == sizeof ...(RTags)>::type* =
618602 nullptr >
619- TUPLES_LIB_CONSTEXPR_CXX_14 bool operator <(TaggedTuple<LTags...> const & lhs,
620- TaggedTuple<RTags...> const & rhs) {
603+ constexpr bool operator <(TaggedTuple<LTags...> const & lhs,
604+ TaggedTuple<RTags...> const & rhs) {
621605 return tuples_detail::tuple_less_impl (lhs, rhs);
622606}
623607
624608template <class ... LTags, class ... RTags,
625609 typename std::enable_if<sizeof ...(LTags) == sizeof ...(RTags)>::type* =
626610 nullptr >
627- TUPLES_LIB_CONSTEXPR_CXX_14 bool operator >(TaggedTuple<LTags...> const & lhs,
628- TaggedTuple<RTags...> const & rhs) {
611+ constexpr bool operator >(TaggedTuple<LTags...> const & lhs,
612+ TaggedTuple<RTags...> const & rhs) {
629613 return rhs < lhs;
630614}
631615
632616template <class ... LTags, class ... RTags,
633617 typename std::enable_if<sizeof ...(LTags) == sizeof ...(RTags)>::type* =
634618 nullptr >
635- TUPLES_LIB_CONSTEXPR_CXX_14 bool operator <=(TaggedTuple<LTags...> const & lhs,
636- TaggedTuple<RTags...> const & rhs) {
619+ constexpr bool operator <=(TaggedTuple<LTags...> const & lhs,
620+ TaggedTuple<RTags...> const & rhs) {
637621 return not (rhs < lhs);
638622}
639623
640624template <class ... LTags, class ... RTags,
641625 typename std::enable_if<sizeof ...(LTags) == sizeof ...(RTags)>::type* =
642626 nullptr >
643- TUPLES_LIB_CONSTEXPR_CXX_14 bool operator >=(TaggedTuple<LTags...> const & lhs,
644- TaggedTuple<RTags...> const & rhs) {
627+ constexpr bool operator >=(TaggedTuple<LTags...> const & lhs,
628+ TaggedTuple<RTags...> const & rhs) {
645629 return not (lhs < rhs);
646630}
647631
0 commit comments