From 19cc797c419e8d1c579565d242643904bb2c5dd8 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Fri, 12 Jan 2018 07:57:17 +0100 Subject: [PATCH] cppbind: fix exporting integer_sequence and small codingstyle fixes --- simgear/misc/CMakeLists.txt | 1 + simgear/misc/integer_sequence.hxx | 4 ++-- simgear/misc/integer_sequence_test.cxx | 4 ++-- simgear/nasal/cppbind/NasalContext.hxx | 4 ++-- simgear/nasal/cppbind/NasalObject.hxx | 2 +- simgear/structure/function_list.hxx | 4 ++-- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/simgear/misc/CMakeLists.txt b/simgear/misc/CMakeLists.txt index 3c5bfedd..c6b0d73a 100644 --- a/simgear/misc/CMakeLists.txt +++ b/simgear/misc/CMakeLists.txt @@ -9,6 +9,7 @@ set(HEADERS SVGpreserveAspectRatio.hxx argparse.hxx interpolator.hxx + integer_sequence.hxx make_new.hxx sg_dir.hxx sg_hash.hxx diff --git a/simgear/misc/integer_sequence.hxx b/simgear/misc/integer_sequence.hxx index 7f372785..47f63c43 100644 --- a/simgear/misc/integer_sequence.hxx +++ b/simgear/misc/integer_sequence.hxx @@ -20,7 +20,7 @@ #ifndef SIMGEAR_MISC_INTEGER_SEQUENCE_HXX_ #define SIMGEAR_MISC_INTEGER_SEQUENCE_HXX_ -#include +#include #include #include @@ -48,7 +48,7 @@ namespace simgear { namespace detail template struct append; - template + template struct append, Int> { using type = std::integer_sequence; diff --git a/simgear/misc/integer_sequence_test.cxx b/simgear/misc/integer_sequence_test.cxx index 82463f50..74ccd3c2 100644 --- a/simgear/misc/integer_sequence_test.cxx +++ b/simgear/misc/integer_sequence_test.cxx @@ -8,13 +8,13 @@ void print(const T& v, std::size_t i) std::cout << "arg #" << i << ": '" << v << "', "; } -template +template void doIt_impl(Args ... args, std::index_sequence) { std::initializer_list{(print(args, Is), '0')...}; } -template +template void doIt(Args ... args) { static_assert(sizeof...(Args) == std::index_sequence_for::size(), ""); diff --git a/simgear/nasal/cppbind/NasalContext.hxx b/simgear/nasal/cppbind/NasalContext.hxx index e9379c9f..d3a3aee5 100644 --- a/simgear/nasal/cppbind/NasalContext.hxx +++ b/simgear/nasal/cppbind/NasalContext.hxx @@ -44,14 +44,14 @@ namespace nasal String newString(const char* str); /** Create a new nasal vector and fill it with the given values */ - template + template naRef newVector(Vals ... vals) { return newVector({to_nasal(vals)...}); } /** Raise a nasal runtime error */ - template + template void runtimeError(const char* fmt, Args ... args) const { naRuntimeError(c_ctx(), fmt, args...); diff --git a/simgear/nasal/cppbind/NasalObject.hxx b/simgear/nasal/cppbind/NasalObject.hxx index 565c1670..c48812cf 100644 --- a/simgear/nasal/cppbind/NasalObject.hxx +++ b/simgear/nasal/cppbind/NasalObject.hxx @@ -45,7 +45,7 @@ namespace nasal bool valid() const; - template + template Ret callMethod(const std::string& name, Args ... args) { if( !_nasal_impl.valid() ) diff --git a/simgear/structure/function_list.hxx b/simgear/structure/function_list.hxx index 5268d2ca..89347636 100644 --- a/simgear/structure/function_list.hxx +++ b/simgear/structure/function_list.hxx @@ -31,7 +31,7 @@ namespace simgear * * @tparam Sig Function signature. */ - template + template class function_list: public std::vector> { @@ -54,7 +54,7 @@ namespace simgear * Handle a list of callbacks with the same signature as the given * boost::function type. */ - template + template class function_list>: public function_list {