From 7631145c298db9e20cec13f7b24053b302ecef81 Mon Sep 17 00:00:00 2001 From: Derek Bailey Date: Wed, 24 Aug 2022 10:54:30 -0700 Subject: [PATCH] Use type traits for specialization --- src/idl_gen_ts.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/idl_gen_ts.cpp b/src/idl_gen_ts.cpp index 042bbba55757..2598c6d2aa4d 100644 --- a/src/idl_gen_ts.cpp +++ b/src/idl_gen_ts.cpp @@ -39,10 +39,11 @@ struct ImportDefinition { enum AnnotationType { kParam = 0, kType = 1, kReturns = 2 }; -template bool SupportsObjectAPI() { return false; } +template +struct SupportsObjectAPI : std::false_type {}; -// Structs can have Object API support. -template<> bool SupportsObjectAPI() { return true; } +template<> +struct SupportsObjectAPI : std::true_type {}; } // namespace