@@ -102,7 +102,7 @@ Based on those limitations, the following mapping design is proposed:
102
102
```
103
103
namespace detail {
104
104
template<auto &SpecName>
105
- const char *get_spec_constant_symbolic_ID();
105
+ inline const char *get_spec_constant_symbolic_ID();
106
106
}
107
107
```
108
108
Which is only declared, but not defined in there and used to retrieve required
@@ -120,11 +120,11 @@ Based on those limitations, the following mapping design is proposed:
120
120
// };
121
121
122
122
template<>
123
- const char *get_spec_constant_symbolic_ID<int_const>() {
123
+ inline const char *get_spec_constant_symbolic_ID<int_const>() {
124
124
return "unique_name_for_int_const";
125
125
}
126
126
template<>
127
- const char *get_spec_constant_symbolic_ID<Wrapper::float_const>() {
127
+ inline const char *get_spec_constant_symbolic_ID<Wrapper::float_const>() {
128
128
return "unique_name_for_Wrapper_float_const";
129
129
}
130
130
}
@@ -712,24 +712,20 @@ Will look like:
712
712
namespace detail {
713
713
// generic declaration
714
714
template<auto &SpecName>
715
- struct get_symbolic_id_helper{} ;
715
+ inline const char *get_spec_constant_symbolic_ID() ;
716
716
717
717
// specializations for each specialization constant:
718
718
// we can refer to all those specialization_id variables, because integration
719
719
// footer was _appended_ to the user-provided translation unit
720
720
template<>
721
- struct get_symbolic_id_helper<id_int> {
722
- static const char *get_symbolic_id() {
723
- return "result of __builtin_unique_ID(id_int) encoded here";
724
- }
725
- };
721
+ inline const char *get_spec_constant_symbolic_ID() {
722
+ return "result of __builtin_unique_ID(id_int) encoded here";
723
+ }
726
724
727
725
template<>
728
- struct get_symbolic_id_helper<id_A> {
729
- static const char *get_symbolic_id() {
730
- return "result of __builtin_unique_ID(A) encoded here";
731
- }
732
- };
726
+ inline const char *get_spec_constant_symbolic_ID() {
727
+ return "result of __builtin_unique_ID(A) encoded here";
728
+ }
733
729
734
730
} // namespace detail
735
731
0 commit comments