From acc74bae8b914896f0d46c2d027b1ec7046148d9 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 7 Jan 2016 15:32:47 +0000 Subject: [PATCH] Buildfix on clang and gcc Release. --- include/pq/implem/pq_type_helpers.hpp | 33 +++++++++++++-------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/include/pq/implem/pq_type_helpers.hpp b/include/pq/implem/pq_type_helpers.hpp index a6060fb..480f0e4 100644 --- a/include/pq/implem/pq_type_helpers.hpp +++ b/include/pq/implem/pq_type_helpers.hpp @@ -94,64 +94,63 @@ namespace pq { template struct type_to_pqtypes_name_impl : public type_to_pqtypes_name { - constexpr static const std::size_t size = strlen(type_to_pqtypes_name::name) + 1; + constexpr static const std::size_t size = strlen(type_to_pqtypes_name::name()) + 1; }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "text"; + constexpr static const char* name ( void ) { return "text"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "text"; + constexpr static const char* name ( void ) { return "text"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "bool"; + constexpr static const char* name ( void ) { return "bool"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "float4"; + constexpr static const char* name ( void ) { return "float4"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "float8"; + constexpr static const char* name ( void ) { return "float8"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "int2"; + constexpr static const char* name ( void ) { return "int2"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "int4"; + constexpr static const char* name ( void ) { return "int4"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "int8"; + constexpr static const char* name ( void ) { return "int8"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "int2"; + constexpr static const char* name ( void ) { return "int2"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "int4"; + constexpr static const char* name ( void ) { return "int4"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "int8"; + constexpr static const char* name ( void ) { return "int8"; } }; template <> struct type_to_pqtypes_name { - constexpr static const char* name = "timestamptz"; + constexpr static const char* name ( void ) { return "timestamptz"; } }; template struct type_to_pqtypes_name> { private: - constexpr static const std::size_t sub_size = strlen(type_to_pqtypes_name::name) + 1; - constexpr static const bt::string sub_name_str = type_to_pqtypes_name::name; + constexpr static const std::size_t sub_size = strlen(type_to_pqtypes_name::name()) + 1; public: - constexpr static bt::string<3 + sub_size - 1> name = sub_name_str + bt::make_string("[]"); + constexpr static bt::string<3 + sub_size - 1> name ( void ) { return bt::string(type_to_pqtypes_name::name()) + bt::make_string("[]"); } }; template @@ -198,7 +197,7 @@ namespace pq { template inline constexpr bt::string::size + 1> make_pqtypes_name (const char parPrefix) { - return bt::make_string<2>({parPrefix, '\0'}) + bt::string::size>(type_to_pqtypes_name_impl::name); + return bt::make_string<2>({parPrefix, '\0'}) + bt::string::size>(type_to_pqtypes_name_impl::name()); } template