mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-11-14 10:39:05 +00:00
add workaround for clang3.4 or later: base class construct
This commit is contained in:
parent
c5d64a7b9c
commit
4bcc5e71fc
2 changed files with 58 additions and 1 deletions
|
@ -20,6 +20,7 @@
|
|||
#if SPROUT_USE_PTR_INDEX_ITERATOR_IMPLEMENTATION
|
||||
# include <sprout/iterator/ptr_index_iterator.hpp>
|
||||
#endif
|
||||
#include <sprout/workaround/base_class_construct.hpp>
|
||||
|
||||
namespace sprout {
|
||||
template<typename Container>
|
||||
|
@ -520,7 +521,24 @@ namespace sprout {
|
|||
, public sprout::detail::inherit_if_const_pointer<sprout::container_traits<Container> >
|
||||
, public sprout::detail::inherit_if_static_size<sprout::container_traits<Container> >
|
||||
, public sprout::detail::container_nosy_fixed_size<sprout::container_traits<Container> >
|
||||
{};
|
||||
{
|
||||
#if SPROUT_NEEDS_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT
|
||||
public:
|
||||
SPROUT_CONSTEXPR container_traits_facade()
|
||||
: SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::inherit_if_value_type<sprout::container_traits<Container> >)
|
||||
, SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::inherit_if_iterator<sprout::container_traits<Container> >)
|
||||
, SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::inherit_if_const_iterator<sprout::container_traits<Container> >)
|
||||
, SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::inherit_if_reference<sprout::container_traits<Container> >)
|
||||
, SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::inherit_if_const_reference<sprout::container_traits<Container> >)
|
||||
, SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::inherit_if_size_type<sprout::container_traits<Container> >)
|
||||
, SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::inherit_if_difference_type<sprout::container_traits<Container> >)
|
||||
, SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::inherit_if_pointer<sprout::container_traits<Container> >)
|
||||
, SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::inherit_if_const_pointer<sprout::container_traits<Container> >)
|
||||
, SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::inherit_if_static_size<sprout::container_traits<Container> >)
|
||||
, SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(sprout::detail::container_nosy_fixed_size<sprout::container_traits<Container> >)
|
||||
{}
|
||||
#endif
|
||||
};
|
||||
|
||||
//
|
||||
// is_fixed_container
|
||||
|
|
39
sprout/workaround/base_class_construct.hpp
Normal file
39
sprout/workaround/base_class_construct.hpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 Bolero MURAKAMI
|
||||
https://github.com/bolero-MURAKAMI/Sprout
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#ifndef SPROUT_WORKAROUND_BASE_CLASS_CONSTRUCT_HPP
|
||||
#define SPROUT_WORKAROUND_BASE_CLASS_CONSTRUCT_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
//
|
||||
// SPROUT_NEEDS_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT
|
||||
//
|
||||
#ifndef SPROUT_NEEDS_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT
|
||||
# if defined(__clang__)
|
||||
# if (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))
|
||||
# define SPROUT_NEEDS_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT 1
|
||||
# else
|
||||
# define SPROUT_NEEDS_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT 0
|
||||
# endif
|
||||
# else
|
||||
# define SPROUT_NEEDS_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT
|
||||
//
|
||||
#ifndef SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT
|
||||
# if SPROUT_NEEDS_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT
|
||||
# define SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(base) base()
|
||||
# else
|
||||
# define SPROUT_EXPLICIT_EMPTY_BASE_CLASS_CONSTRUCT(base)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif // #ifndef SPROUT_WORKAROUND_BASE_CLASS_CONSTRUCT_HPP
|
Loading…
Reference in a new issue