6
6
#define DYNO_VTABLE_HPP
7
7
8
8
#include < dyno/concept.hpp>
9
+ #include < dyno/detail/dsl.hpp>
9
10
#include < dyno/detail/erase_function.hpp>
10
11
#include < dyno/detail/erase_signature.hpp>
11
12
@@ -208,11 +209,11 @@ struct joined_vtable {
208
209
209
210
// ////////////////////////////////////////////////////////////////////////////
210
211
// Selectors
211
- template <typename ...Functions>
212
+ template <char const * ...Functions>
212
213
struct only {
213
214
template <typename All>
214
215
constexpr auto operator ()(All all) const {
215
- auto matched = boost::hana::make_set (Functions{} ...);
216
+ auto matched = boost::hana::make_set (detail::make_string< Functions>() ...);
216
217
static_assert (decltype (boost::hana::is_subset (matched, all))::value,
217
218
" dyno::only: Some functions specified in this selector are not part of "
218
219
" the concept to which the selector was applied." );
@@ -223,11 +224,11 @@ struct only {
223
224
}
224
225
};
225
226
226
- template <typename ...Functions>
227
+ template <char const * ...Functions>
227
228
struct except {
228
229
template <typename All>
229
230
constexpr auto operator ()(All all) const {
230
- auto not_matched = boost::hana::make_set (Functions{} ...);
231
+ auto not_matched = boost::hana::make_set (detail::make_string< Functions>() ...);
231
232
static_assert (decltype (boost::hana::is_subset (not_matched, all))::value,
232
233
" dyno::except: Some functions specified in this selector are not part of "
233
234
" the concept to which the selector was applied." );
@@ -251,12 +252,12 @@ namespace detail {
251
252
template <typename T>
252
253
struct is_valid_selector : boost::hana::false_ { };
253
254
254
- template <typename ...Methods>
255
+ template <char const * ...Methods>
255
256
struct is_valid_selector <dyno::only<Methods...>>
256
257
: boost::hana::true_
257
258
{ };
258
259
259
- template <typename ...Methods>
260
+ template <char const * ...Methods>
260
261
struct is_valid_selector <dyno::except<Methods...>>
261
262
: boost::hana::true_
262
263
{ };
@@ -389,12 +390,12 @@ constexpr auto generate_vtable(Policies policies) {
389
390
// cumbersome. Selectors provided by the library are:
390
391
//
391
392
// dyno::only<functions...>
392
- // Picks only the specified functions from a concept. `functions` must be
393
- // compile-time strings, such as `dyno::only<decltype( "foo"_s), decltype( "bar"_s) >`.
393
+ // Picks only the specified functions from a concept. `functions... ` must
394
+ // be compile-time strings, such as `dyno::only<"foo"_s, "bar"_s>`.
394
395
//
395
396
// dyno::except<functions...>
396
- // Picks all but the specified functions from a concept. `functions` must
397
- // be compile-time strings, such as `dyno::except<decltype( "foo"_s), decltype( "bar"_s) >`.
397
+ // Picks all but the specified functions from a concept. `functions...`
398
+ // must be compile-time strings, such as `dyno::except<"foo"_s, "bar"_s>`.
398
399
//
399
400
// dyno::everything
400
401
// Picks all the functions from a concept.
0 commit comments