Skip to content

Commit a1fd13e

Browse files
committed
fix warn(#76)
1 parent 3f4ebb0 commit a1fd13e

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

include/anyany/anyany.hpp

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,17 @@ template <typename X, anyany_simple_method_concept... Methods>
217217
struct exist_for {
218218
private:
219219
template <typename T, typename Method>
220-
static auto check_fn(int) -> decltype(Method::template do_invoke<T>, std::true_type{});
220+
static auto check_fn(int) -> decltype(Method::template do_invoke<T>, std::true_type{}) {
221+
throw;
222+
}
221223
template <typename T, typename Method> // for pseudomethods, must be consteval fn
222-
static auto check_fn(bool) -> decltype(Method{}.template do_value<T>(), std::true_type{});
224+
static auto check_fn(bool) -> decltype(Method{}.template do_value<T>(), std::true_type{}) {
225+
throw;
226+
}
223227
template <typename, typename>
224-
static auto check_fn(...) -> std::false_type;
228+
static auto check_fn(...) -> std::false_type {
229+
throw;
230+
}
225231

226232
public:
227233
static constexpr inline bool value = (decltype(check_fn<std::decay_t<X>, Methods>(0))::value && ...);
@@ -316,9 +322,13 @@ struct copy_method {
316322

317323
namespace noexport {
318324

319-
auto get_any_copy_method(type_list<>) -> void;
325+
inline auto get_any_copy_method(type_list<>) -> void {
326+
throw;
327+
}
320328
template <typename A, size_t N, typename... Tail>
321-
auto get_any_copy_method(type_list<copy_method<A, N>, Tail...>) -> copy_method<A, N>;
329+
auto get_any_copy_method(type_list<copy_method<A, N>, Tail...>) -> copy_method<A, N> {
330+
throw;
331+
}
322332
template <typename Head, typename... Tail>
323333
auto get_any_copy_method(type_list<Head, Tail...>) {
324334
return get_any_copy_method(type_list<Tail...>{});
@@ -514,9 +524,13 @@ namespace noexport {
514524
// searches for ::type,
515525
// if no ::type, then Plugin itself used
516526
template <typename Plugin>
517-
auto select_plugin(int) -> typename Plugin::type;
527+
auto select_plugin(int) -> typename Plugin::type {
528+
throw;
529+
}
518530
template <typename Plugin>
519-
auto select_plugin(...) -> Plugin;
531+
auto select_plugin(...) -> Plugin {
532+
throw;
533+
}
520534

521535
} // namespace noexport
522536

include/anyany/noexport/anyany_details.hpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ template <typename... Ts>
187187
struct AA_MSVC_EBO inheritor_of : Ts... {};
188188

189189
template <typename... Results>
190-
auto inherit_without_duplicates(type_list<>, type_list<Results...>) -> inheritor_of<Results...>;
190+
auto inherit_without_duplicates(type_list<>, type_list<Results...>) -> inheritor_of<Results...> {
191+
throw;
192+
}
191193

192194
template <typename Head, typename... Tail, typename... Results>
193195
auto inherit_without_duplicates(type_list<Head, Tail...>, type_list<Results...> l) {
@@ -212,12 +214,18 @@ struct type_identity {
212214
};
213215

214216
template <typename Method>
215-
auto get_method_signature(int) -> type_identity<typename Method::signature_type>;
217+
auto get_method_signature(int) -> type_identity<typename Method::signature_type> {
218+
throw;
219+
}
216220
template <typename Method>
217221
auto get_method_signature(bool)
218-
-> type_identity<std::remove_pointer_t<decltype(&Method::template do_invoke<erased_self_t>)>>;
222+
-> type_identity<std::remove_pointer_t<decltype(&Method::template do_invoke<erased_self_t>)>> {
223+
throw;
224+
}
219225
template <typename Method>
220-
auto get_method_signature(...) -> type_identity<typename Method::value_type>;
226+
auto get_method_signature(...) -> type_identity<typename Method::value_type> {
227+
throw;
228+
}
221229

222230
template <typename Method>
223231
using signature_t = typename decltype(get_method_signature<Method>(0))::type;
@@ -327,7 +335,9 @@ constexpr bool contains_second_layer_list(aa::type_list<Ts...>) {
327335
}
328336

329337
template <template <typename...> typename Template, typename... Types>
330-
auto insert_types(aa::type_list<Types...>) -> Template<Types...>;
338+
auto insert_types(aa::type_list<Types...>) -> Template<Types...> {
339+
throw;
340+
}
331341

332342
template <typename, typename T>
333343
using enable_if_impl = T;

0 commit comments

Comments
 (0)