File tree 1 file changed +13
-3
lines changed 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 6
6
#include < type_traits>
7
7
#include < utility>
8
8
9
+ #if (defined _MSC_VER)
10
+ #if (defined __clang__)
11
+ #define TUPLET_NO_UNIQUE_ADDRESS
12
+ #else
13
+ #define TUPLET_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
14
+ #endif
15
+ #else
16
+ #define TUPLET_NO_UNIQUE_ADDRESS [[no_unique_address]]
17
+ #endif
18
+
9
19
// tuplet concepts and traits
10
20
namespace tuplet {
11
21
template <class T >
@@ -94,7 +104,7 @@ struct tuple_elem {
94
104
static T decl_elem (tag<I>);
95
105
using type = T;
96
106
97
- [[no_unique_address]] T value;
107
+ TUPLET_NO_UNIQUE_ADDRESS T value;
98
108
99
109
constexpr decltype (auto ) operator[](tag<I>) & { return (value); }
100
110
constexpr decltype (auto ) operator[](tag<I>) const & { return (value); }
@@ -242,8 +252,8 @@ namespace tuplet {
242
252
template <class First , class Second >
243
253
struct pair {
244
254
constexpr static size_t N = 2 ;
245
- [[no_unique_address]] First first;
246
- [[no_unique_address]] Second second;
255
+ TUPLET_NO_UNIQUE_ADDRESS First first;
256
+ TUPLET_NO_UNIQUE_ADDRESS Second second;
247
257
248
258
constexpr decltype (auto ) operator[](tag<0 >) & { return (first); }
249
259
constexpr decltype (auto ) operator[](tag<0 >) const & { return (first); }
You can’t perform that action at this time.
0 commit comments