Permalink
Browse files

Boost.Container's small_vector is only usable if the Boost version >=…

… 1.61 (HT @ngovind )
  • Loading branch information...
evaleev committed Nov 27, 2018
1 parent 56bacd8 commit 08aece035bd342fe798e3b3d0f16c17d7c5c9f16
Showing with 14 additions and 6 deletions.
  1. +1 −0 CHANGES
  2. +13 −6 include/libint2/util/small_vector.h
@@ -6,6 +6,7 @@ Following is a brief summary of changes made in each release of Libint.
- 2018-xx-yy: 2.5.0-beta.3
- validation target in exported library works correctly in absence of C++11 API
- cleanup of molden exporter
- Boost.Container's small_vector is only usable if the Boost version >= 1.61
- 2018-08-13: 2.5.0-beta.2
- fixed molden exporter
@@ -21,12 +21,19 @@
#ifndef _libint2_include_libint2_util_smallvector_h_
#define _libint2_include_libint2_util_smallvector_h_
#if __has_include(<boost/container/small_vector.hpp>) && !defined(LIBINT2_DISABLE_BOOST_CONTAINER_SMALL_VECTOR)
# define LIBINT2_HAS_BOOST_CONTAINER_SMALL_VECTOR_H 1
# if !defined(LIBINT2_SVECTOR_OPTIMIZED_RANK) // user can override by defining LIBINT2_SVECTOR_OPTIMIZED_RANK
# define LIBINT2_SVECTOR_OPTIMIZED_RANK 6
# endif
# include <boost/container/small_vector.hpp>
// Boost.Container's small_vector is interoperable with std::vector starting with version 1.61 or later
// see https://www.boost.org/doc/libs/1_61_0/doc/html/boost/container/small_vector.html#idp20337968-bb
#if __has_include(<boost/version.hpp>) && __has_include(<boost/container/small_vector.hpp>) && !defined(LIBINT2_DISABLE_BOOST_CONTAINER_SMALL_VECTOR)
# include <boost/version.hpp> // read in version and do version check
# if defined(BOOST_VERSION)
# if (BOOST_VERSION / 100000 == 1) && ((BOOST_VERSION / 100 % 1000) >= 61)
# define LIBINT2_HAS_BOOST_CONTAINER_SMALL_VECTOR_H 1
# if !defined(LIBINT2_SVECTOR_OPTIMIZED_RANK) // user can override by defining LIBINT2_SVECTOR_OPTIMIZED_RANK
# define LIBINT2_SVECTOR_OPTIMIZED_RANK 6
# endif
# include <boost/container/small_vector.hpp>
# endif // boost version >= 1.61
# endif // defined(BOOST_VERSION)
#else
# include <vector>
#endif

0 comments on commit 08aece0

Please sign in to comment.