diff --git a/src/idl_gen_ts.cpp b/src/idl_gen_ts.cpp index 042bbba5575..f2d1b57f5a0 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 @@ -756,7 +757,7 @@ class TsGenerator : public BaseGenerator { flat_file_import_declarations_[file][import_name] = name; if (parser_.opts.generate_object_based_api && - SupportsObjectAPI()) { + SupportsObjectAPI::value) { flat_file_import_declarations_[file][import_name + "T"] = object_name; } }