diff --git a/examples/constexpr14_namespace_check.cpp b/examples/constexpr14_namespace_check.cpp index 0752e08..4fa7192 100644 --- a/examples/constexpr14_namespace_check.cpp +++ b/examples/constexpr14_namespace_check.cpp @@ -54,7 +54,7 @@ constexpr bool in_namespace(const char (&ns)[N]) noexcept { namespace my_project { struct serializer { template - void serialize(const T& value) { + void serialize(const T&) { static_assert( in_namespace("my_project::types") || in_namespace("my_project::types_ext"), "Only types from namespaces `my_project::types` and `my_project::types_ext` are allowed to be serialized using `my_project::serializer`" diff --git a/examples/constexpr14_sort_check.cpp b/examples/constexpr14_sort_check.cpp index 5443924..ff573aa 100644 --- a/examples/constexpr14_sort_check.cpp +++ b/examples/constexpr14_sort_check.cpp @@ -55,7 +55,7 @@ constexpr bool is_asc_sorted(types) noexcept { // Using the newly created `is_asc_sorted` trait: template -void do_something(const types& t) noexcept { +void do_something(const types&) noexcept { static_assert( is_asc_sorted( types() ), "T... for do_something(const types& t) must be sorted ascending" diff --git a/examples/registry.cpp b/examples/registry.cpp index 4f1eaa8..02f811d 100644 --- a/examples/registry.cpp +++ b/examples/registry.cpp @@ -40,6 +40,7 @@ int main() { // Const, volatile and reference will be striped from the type: bool is_inserted = types.insert(boost::typeindex::type_id()).second; + (void)is_inserted; assert(!is_inserted); assert(types.erase(boost::typeindex::type_id()) == 1); diff --git a/examples/user_defined_typeinfo.cpp b/examples/user_defined_typeinfo.cpp index b4fd076..59b47d3 100644 --- a/examples/user_defined_typeinfo.cpp +++ b/examples/user_defined_typeinfo.cpp @@ -53,6 +53,7 @@ int main() { */ my_struct str; my_class& reference = str; + (void)reference; assert(my_type_index::type_id() == my_type_index::type_id_runtime(reference)); //][/type_index_my_type_index_type_id_runtime_test] diff --git a/examples/user_defined_typeinfo.hpp b/examples/user_defined_typeinfo.hpp index dc2caab..4bd7ff0 100644 --- a/examples/user_defined_typeinfo.hpp +++ b/examples/user_defined_typeinfo.hpp @@ -47,11 +47,20 @@ namespace my_namespace { namespace detail { template <> struct typenum{ enum {value = 3}; }; template <> struct typenum{ enum {value = 4}; }; +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4510 4512 4610) // non-copyable non-constructable type +#endif + // my_typeinfo structure is used to save type number struct my_typeinfo { const char* const type_; }; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + const my_typeinfo infos[5] = { {"void"}, {"my_class"}, {"my_struct"}, {"my_classes"}, {"my_string"} }; diff --git a/include/boost/type_index/stl_type_index.hpp b/include/boost/type_index/stl_type_index.hpp index dcc532d..c2564b0 100644 --- a/include/boost/type_index/stl_type_index.hpp +++ b/include/boost/type_index/stl_type_index.hpp @@ -268,6 +268,7 @@ inline stl_type_index stl_type_index::type_id_with_cvr() BOOST_NOEXCEPT { template inline stl_type_index stl_type_index::type_id_runtime(const T& value) BOOST_NOEXCEPT { + (void)value; #ifdef BOOST_NO_RTTI return value.boost_type_index_type_id_runtime_(); #else