Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ jobs:
container: ubuntu:24.04
os: ubuntu-latest
install: clang-18
- toolset: clang
compiler: clang++-19
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-19
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-13
Expand Down
14 changes: 12 additions & 2 deletions doc/release_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ <h1><img src="../../../boost.png" alt="Boost logo" align=
<h2>Contents</h2>

<ul>
<li><a href="#boost_1_90">Boost 1.90 release</a></li>
<li><a href="#boost_1_87">Boost 1.87 release</a></li>
<li><a href="#boost_1_83">Boost 1.83 release</a></li>
<li><a href="#boost_1_82">Boost 1.82 release</a></li>
Expand All @@ -51,6 +52,15 @@ <h2>Contents</h2>
<li><a href="#boost_1_38">Boost 1.38 release</a></li>
</ul>

<h2><a name="boost_1_90">Boost 1.90 release</a></h2>

<p>
<ul>
<li>Fixed compile errors in Clang 19 and later due to
<a href="https://wg21.link/p0522r0">P0522R0</a> support.</li>
</ul>
</p>

<h2><a name="boost_1_87">Boost 1.87 release</a></h2>

<p>
Expand Down Expand Up @@ -257,9 +267,9 @@ <h2><a name="boost_1_38">Boost 1.38 release</a></h2>

<br>

<p>Revised September 29th 2024</p>
<p>Revised September 20th 2025</p>

<p>&copy; Copyright 2006-2024 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
<p>&copy; Copyright 2006-2025 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
Distributed under the Boost Software
License, Version 1.0. (See accompanying file <a href="../../../LICENSE_1_0.txt">
LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
Expand Down
180 changes: 150 additions & 30 deletions include/boost/flyweight/detail/not_placeholder_expr.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2006-2024 Joaquin M Lopez Munoz.
/* Copyright 2006-2025 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -13,6 +13,11 @@
#pragma once
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/aux_/lambda_arity_param.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/lambda_fwd.hpp>

/* BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION can be inserted at the end
* of a class template parameter declaration:
* template<
Expand All @@ -26,38 +31,153 @@
* MPL invocation.
*/

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/config/workaround.hpp>

#if BOOST_WORKAROUND(__GNUC__, <4)||\
BOOST_WORKAROUND(__GNUC__,==4)&&(__GNUC_MINOR__<2)||\
BOOST_WORKAROUND(__GNUC__, ==7)&&( __cplusplus>=201703L)||\
BOOST_WORKAROUND(__GNUC__, >=8)&&( __cplusplus>=201103L)
/* The default trick on which the macro is based, namely adding a int=0
* defaulted template parameter, does not work in GCC prior to 4.2 due to
* an unfortunate compiler non-standard extension, as explained in
* http://lists.boost.org/boost-users/2007/07/29866.php
* As it happens, GCC 7 in C++17 mode and GCC 8 (and presumably later) in
* C++11 mode (and presumably later) go back to this old behavior, anticipating
* the resolution of CWG DR 150 (see P0522R0).
* In these cases we resort to an uglier technique, adding defaulted template
* parameters so as to exceed BOOST_MPL_LIMIT_METAFUNCTION_ARITY.
namespace boost{

namespace flyweights{

namespace detail{

struct not_a_ph_expr;

} /* namespace flyweights::detail */

} /* namespace flyweights */

} /* namespace boost */

#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG \
(boost::flyweights::detail::not_a_ph_expr*)0
#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION \
,boost::flyweights::detail::not_a_ph_expr* = \
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG
#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF \
,boost::flyweights::detail::not_a_ph_expr*

/* Even though, under the definition given by Boost.MPL, the inclusion of a
* non-type template parameter makes a class template instantiation not a
* placeholder expression, https://wg21.link/p0522r0, which allows
* template-parameters to bind ignoring default arguments, causes
* boost::mpl::lambda to fail to properly honor
* BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION (in P0552R0-compliant
* compilers). We fix this by specializing boost::mpl::lambda accordingly.
*/

#include <boost/mpl/limits/arity.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
namespace boost{

#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION \
BOOST_PP_ENUM_TRAILING_PARAMS( \
BOOST_MPL_LIMIT_METAFUNCTION_ARITY,typename=int BOOST_PP_INTERCEPT)
#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF \
BOOST_PP_ENUM_TRAILING_PARAMS( \
BOOST_MPL_LIMIT_METAFUNCTION_ARITY,typename BOOST_PP_INTERCEPT)
namespace mpl{

#else
#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION ,int=0
#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF ,int
#endif
template<
template<
typename
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
> class F,
typename T1,
typename Tag
>
struct lambda<
F<T1,BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG>,
Tag
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<1>)
>
{
typedef false_ is_le;
typedef F<
T1,
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG
> result_;
typedef result_ type;
};

template<
template<
typename,typename
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
> class F,
typename T1,typename T2,
typename Tag
>
struct lambda<
F<T1,T2,BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG>,
Tag
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<2>)
>
{
typedef false_ is_le;
typedef F<
T1,T2,
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG
> result_;
typedef result_ type;
};

template<
template<
typename,typename,typename
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
> class F,
typename T1,typename T2,typename T3,
typename Tag
>
struct lambda<
F<T1,T2,T3,BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG>,
Tag
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<3>)
>
{
typedef false_ is_le;
typedef F<
T1,T2,T3,
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG
> result_;
typedef result_ type;
};

template<
template<
typename,typename,typename,typename
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
> class F,
typename T1,typename T2,typename T3,typename T4,
typename Tag
>
struct lambda<
F<T1,T2,T3,T4,BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG>,
Tag
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<4>)
>
{
typedef false_ is_le;
typedef F<
T1,T2,T3,T4,
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG
> result_;
typedef result_ type;
};

template<
template<
typename,typename,typename,typename,typename
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
> class F,
typename T1,typename T2,typename T3,typename T4,typename T5,
typename Tag
>
struct lambda<
F<T1,T2,T3,T4,T5,BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG>,
Tag
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<5>)
>
{
typedef false_ is_le;
typedef F<
T1,T2,T3,T4,T5,
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_ARG
> result_;
typedef result_ type;
};

} /* namespace mpl */

} /* namespace boost */

#endif