Skip to content

Commit 0140a8a

Browse files
committed
Ah, I still support C++17 :(
1 parent 8611e78 commit 0140a8a

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

include/ctre/return_type.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ template <size_t Id, typename Name = void> struct captured_content {
8080
} else { // I'm doing this to avoid warning about dead code
8181
#endif
8282

83+
#if __cpp_lib_to_address >= 201711L
8384
return std::to_address(_begin);
85+
#else
86+
return &*_begin;
87+
#endif
8488

8589
#if __cpp_char8_t >= 201811
8690
}

single-header/ctre-unicode.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3368,7 +3368,11 @@ template <size_t Id, typename Name = void> struct captured_content {
33683368
} else { // I'm doing this to avoid warning about dead code
33693369
#endif
33703370

3371+
#if __cpp_lib_to_address >= 201711L
33713372
return std::to_address(_begin);
3373+
#else
3374+
return &*_begin;
3375+
#endif
33723376

33733377
#if __cpp_char8_t >= 201811
33743378
}

single-header/ctre.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3365,7 +3365,11 @@ template <size_t Id, typename Name = void> struct captured_content {
33653365
} else { // I'm doing this to avoid warning about dead code
33663366
#endif
33673367

3368+
#if __cpp_lib_to_address >= 201711L
33683369
return std::to_address(_begin);
3370+
#else
3371+
return &*_begin;
3372+
#endif
33693373

33703374
#if __cpp_char8_t >= 201811
33713375
}

0 commit comments

Comments
 (0)