From 76718f966e6801f84e4731406bf1a5feb19fee5e Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Fri, 19 Sep 2025 10:16:31 +0200
Subject: [PATCH 01/12] resorted to P0522R0-compliant
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION for Clang>=19
---
include/boost/flyweight/detail/not_placeholder_expr.hpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/boost/flyweight/detail/not_placeholder_expr.hpp b/include/boost/flyweight/detail/not_placeholder_expr.hpp
index 53271f7..ef48e3c 100644
--- a/include/boost/flyweight/detail/not_placeholder_expr.hpp
+++ b/include/boost/flyweight/detail/not_placeholder_expr.hpp
@@ -32,7 +32,8 @@
#if BOOST_WORKAROUND(__GNUC__, <4)||\
BOOST_WORKAROUND(__GNUC__,==4)&&(__GNUC_MINOR__<2)||\
BOOST_WORKAROUND(__GNUC__, ==7)&&( __cplusplus>=201703L)||\
- BOOST_WORKAROUND(__GNUC__, >=8)&&( __cplusplus>=201103L)
+ BOOST_WORKAROUND(__GNUC__, >=8)&&( __cplusplus>=201103L)||\
+ BOOST_WORKAROUND(__clang_major__,>=19)
/* 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
@@ -40,6 +41,7 @@
* 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).
+ * Clang 19 and later also implement P0522R0 by default.
* In these cases we resort to an uglier technique, adding defaulted template
* parameters so as to exceed BOOST_MPL_LIMIT_METAFUNCTION_ARITY.
*/
From 94bc1ea165f012603c765705c11b3aeb6cdc682a Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Fri, 19 Sep 2025 10:53:09 +0200
Subject: [PATCH 02/12] (debugging) output __clang_major__ when available
---
include/boost/flyweight/detail/not_placeholder_expr.hpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/boost/flyweight/detail/not_placeholder_expr.hpp b/include/boost/flyweight/detail/not_placeholder_expr.hpp
index ef48e3c..ed4c77a 100644
--- a/include/boost/flyweight/detail/not_placeholder_expr.hpp
+++ b/include/boost/flyweight/detail/not_placeholder_expr.hpp
@@ -29,6 +29,13 @@
#include /* keep it first to prevent nasty warns in MSVC */
#include
+#ifdef __clang__
+# pragma message("__clang__ defined")
+# pragma message("clang major = " _CRT_STRINGIZE(__clang_major__))
+#else
+# pragma message("__clang__ NOT defined")
+#endif
+
#if BOOST_WORKAROUND(__GNUC__, <4)||\
BOOST_WORKAROUND(__GNUC__,==4)&&(__GNUC_MINOR__<2)||\
BOOST_WORKAROUND(__GNUC__, ==7)&&( __cplusplus>=201703L)||\
From 869e8b7b5f862e211ada7fbf8e5690c1f911f874 Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Fri, 19 Sep 2025 10:58:52 +0200
Subject: [PATCH 03/12] unconditionally use P0522R0-compliant
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION
---
include/boost/flyweight/detail/not_placeholder_expr.hpp | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/include/boost/flyweight/detail/not_placeholder_expr.hpp b/include/boost/flyweight/detail/not_placeholder_expr.hpp
index ed4c77a..7da658a 100644
--- a/include/boost/flyweight/detail/not_placeholder_expr.hpp
+++ b/include/boost/flyweight/detail/not_placeholder_expr.hpp
@@ -29,14 +29,7 @@
#include /* keep it first to prevent nasty warns in MSVC */
#include
-#ifdef __clang__
-# pragma message("__clang__ defined")
-# pragma message("clang major = " _CRT_STRINGIZE(__clang_major__))
-#else
-# pragma message("__clang__ NOT defined")
-#endif
-
-#if BOOST_WORKAROUND(__GNUC__, <4)||\
+#if 1||BOOST_WORKAROUND(__GNUC__, <4)||\
BOOST_WORKAROUND(__GNUC__,==4)&&(__GNUC_MINOR__<2)||\
BOOST_WORKAROUND(__GNUC__, ==7)&&( __cplusplus>=201703L)||\
BOOST_WORKAROUND(__GNUC__, >=8)&&( __cplusplus>=201103L)||\
From df7436eb37d5c7cc8b6cb26ea54dc4c1c2d4e78c Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Fri, 19 Sep 2025 16:26:17 +0200
Subject: [PATCH 04/12] reverted
---
include/boost/flyweight/detail/not_placeholder_expr.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/boost/flyweight/detail/not_placeholder_expr.hpp b/include/boost/flyweight/detail/not_placeholder_expr.hpp
index 7da658a..ef48e3c 100644
--- a/include/boost/flyweight/detail/not_placeholder_expr.hpp
+++ b/include/boost/flyweight/detail/not_placeholder_expr.hpp
@@ -29,7 +29,7 @@
#include /* keep it first to prevent nasty warns in MSVC */
#include
-#if 1||BOOST_WORKAROUND(__GNUC__, <4)||\
+#if BOOST_WORKAROUND(__GNUC__, <4)||\
BOOST_WORKAROUND(__GNUC__,==4)&&(__GNUC_MINOR__<2)||\
BOOST_WORKAROUND(__GNUC__, ==7)&&( __cplusplus>=201703L)||\
BOOST_WORKAROUND(__GNUC__, >=8)&&( __cplusplus>=201103L)||\
From a88b2a56b2f23c4f7dc979d3795efb6f3c8d3fe5 Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Fri, 19 Sep 2025 16:28:44 +0200
Subject: [PATCH 05/12] added clang++-19 job
---
.github/workflows/ci.yml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4231b68..6b11981 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -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
From c0b4bfa8b9737b733b64508cf8880a33a5863e07 Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Fri, 19 Sep 2025 16:47:20 +0200
Subject: [PATCH 06/12] (debugging) output BOOST_MPL_LIMIT_METAFUNCTION_ARITY
---
include/boost/flyweight/detail/not_placeholder_expr.hpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/boost/flyweight/detail/not_placeholder_expr.hpp b/include/boost/flyweight/detail/not_placeholder_expr.hpp
index ef48e3c..2d6033c 100644
--- a/include/boost/flyweight/detail/not_placeholder_expr.hpp
+++ b/include/boost/flyweight/detail/not_placeholder_expr.hpp
@@ -46,6 +46,10 @@
* parameters so as to exceed BOOST_MPL_LIMIT_METAFUNCTION_ARITY.
*/
+#ifdef __clang__
+# pragma message("BOOST_MPL_LIMIT_METAFUNCTION_ARITY = " _CRT_STRINGIZE(BOOST_MPL_LIMIT_METAFUNCTION_ARITY))
+#endif
+
#include
#include
#include
From b9bc42be8a7c7114a92c08c9946451cf63adf651 Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Fri, 19 Sep 2025 16:58:46 +0200
Subject: [PATCH 07/12] (debugging) #defined
BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
---
include/boost/flyweight/detail/not_placeholder_expr.hpp | 4 ----
test/test_basic.cpp | 1 +
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/include/boost/flyweight/detail/not_placeholder_expr.hpp b/include/boost/flyweight/detail/not_placeholder_expr.hpp
index 2d6033c..ef48e3c 100644
--- a/include/boost/flyweight/detail/not_placeholder_expr.hpp
+++ b/include/boost/flyweight/detail/not_placeholder_expr.hpp
@@ -46,10 +46,6 @@
* parameters so as to exceed BOOST_MPL_LIMIT_METAFUNCTION_ARITY.
*/
-#ifdef __clang__
-# pragma message("BOOST_MPL_LIMIT_METAFUNCTION_ARITY = " _CRT_STRINGIZE(BOOST_MPL_LIMIT_METAFUNCTION_ARITY))
-#endif
-
#include
#include
#include
diff --git a/test/test_basic.cpp b/test/test_basic.cpp
index 53285ec..7de16cf 100644
--- a/test/test_basic.cpp
+++ b/test/test_basic.cpp
@@ -10,6 +10,7 @@
#include "test_basic.hpp"
+#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#include /* keep it first to prevent nasty warns in MSVC */
#include
#include "test_basic_template.hpp"
From 090db3e5c86119cad424b1c72c662005fe86b006 Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Fri, 19 Sep 2025 19:19:32 +0200
Subject: [PATCH 08/12] expanded length of
BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION
---
include/boost/flyweight/detail/not_placeholder_expr.hpp | 5 +++--
test/test_basic.cpp | 1 -
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/boost/flyweight/detail/not_placeholder_expr.hpp b/include/boost/flyweight/detail/not_placeholder_expr.hpp
index ef48e3c..201fe02 100644
--- a/include/boost/flyweight/detail/not_placeholder_expr.hpp
+++ b/include/boost/flyweight/detail/not_placeholder_expr.hpp
@@ -47,15 +47,16 @@
*/
#include
+#include
#include
#include
#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION \
BOOST_PP_ENUM_TRAILING_PARAMS( \
- BOOST_MPL_LIMIT_METAFUNCTION_ARITY,typename=int BOOST_PP_INTERCEPT)
+ BOOST_PP_MUL(BOOST_MPL_LIMIT_METAFUNCTION_ARITY,10),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)
+ BOOST_PP_MUL(BOOST_MPL_LIMIT_METAFUNCTION_ARITY,10),typename BOOST_PP_INTERCEPT)
#else
#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION ,int=0
diff --git a/test/test_basic.cpp b/test/test_basic.cpp
index 7de16cf..53285ec 100644
--- a/test/test_basic.cpp
+++ b/test/test_basic.cpp
@@ -10,7 +10,6 @@
#include "test_basic.hpp"
-#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#include /* keep it first to prevent nasty warns in MSVC */
#include
#include "test_basic_template.hpp"
From 3232acb7f61bd9493cb72131accc7cacfad98d44 Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Fri, 19 Sep 2025 20:02:05 +0200
Subject: [PATCH 09/12] tried alternative mechanism (draft)
---
.../flyweight/detail/not_placeholder_expr.hpp | 5 ++---
include/boost/flyweight/hashed_factory.hpp | 2 +-
.../boost/flyweight/hashed_factory_fwd.hpp | 19 ++++++++++++++++++-
3 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/include/boost/flyweight/detail/not_placeholder_expr.hpp b/include/boost/flyweight/detail/not_placeholder_expr.hpp
index 201fe02..ef48e3c 100644
--- a/include/boost/flyweight/detail/not_placeholder_expr.hpp
+++ b/include/boost/flyweight/detail/not_placeholder_expr.hpp
@@ -47,16 +47,15 @@
*/
#include
-#include
#include
#include
#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION \
BOOST_PP_ENUM_TRAILING_PARAMS( \
- BOOST_PP_MUL(BOOST_MPL_LIMIT_METAFUNCTION_ARITY,10),typename=int BOOST_PP_INTERCEPT)
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY,typename=int BOOST_PP_INTERCEPT)
#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF \
BOOST_PP_ENUM_TRAILING_PARAMS( \
- BOOST_PP_MUL(BOOST_MPL_LIMIT_METAFUNCTION_ARITY,10),typename BOOST_PP_INTERCEPT)
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY,typename BOOST_PP_INTERCEPT)
#else
#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION ,int=0
diff --git a/include/boost/flyweight/hashed_factory.hpp b/include/boost/flyweight/hashed_factory.hpp
index 899eb61..c0221dd 100644
--- a/include/boost/flyweight/hashed_factory.hpp
+++ b/include/boost/flyweight/hashed_factory.hpp
@@ -103,7 +103,7 @@ class hashed_factory_class:public factory_marker
template<
typename Hash,typename Pred,typename Allocator
- BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
+ ,int//BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
>
struct hashed_factory:factory_marker
{
diff --git a/include/boost/flyweight/hashed_factory_fwd.hpp b/include/boost/flyweight/hashed_factory_fwd.hpp
index a934118..e609366 100644
--- a/include/boost/flyweight/hashed_factory_fwd.hpp
+++ b/include/boost/flyweight/hashed_factory_fwd.hpp
@@ -29,7 +29,8 @@ class hashed_factory_class;
template<
typename Hash=mpl::na,typename Pred=mpl::na,typename Allocator=mpl::na
- BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION
+ ,int=666
+ //BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION
>
struct hashed_factory;
@@ -37,4 +38,20 @@ struct hashed_factory;
} /* namespace boost */
+namespace boost{
+namespace mpl{
+
+template<
+ template class F,
+ typename H,typename P,typename A,
+ typename Tag
+>
+struct lambda,Tag>
+{
+ typedef F type;
+};
+
+}
+}
+
#endif
From 233c9d33dfa03c8bd5b0febfbfbd7a16c1d5b521 Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Sat, 20 Sep 2025 10:20:19 +0200
Subject: [PATCH 10/12] refined alternative mechanism
---
.../flyweight/detail/not_placeholder_expr.hpp | 175 ++++++++++++++----
include/boost/flyweight/hashed_factory.hpp | 2 +-
.../boost/flyweight/hashed_factory_fwd.hpp | 19 +-
3 files changed, 144 insertions(+), 52 deletions(-)
diff --git a/include/boost/flyweight/detail/not_placeholder_expr.hpp b/include/boost/flyweight/detail/not_placeholder_expr.hpp
index ef48e3c..f2176ed 100644
--- a/include/boost/flyweight/detail/not_placeholder_expr.hpp
+++ b/include/boost/flyweight/detail/not_placeholder_expr.hpp
@@ -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)
@@ -13,6 +13,11 @@
#pragma once
#endif
+#include /* keep it first to prevent nasty warns in MSVC */
+#include
+#include
+#include
+
/* BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION can be inserted at the end
* of a class template parameter declaration:
* template<
@@ -26,40 +31,144 @@
* MPL invocation.
*/
-#include /* keep it first to prevent nasty warns in MSVC */
-#include
-
-#if BOOST_WORKAROUND(__GNUC__, <4)||\
- BOOST_WORKAROUND(__GNUC__,==4)&&(__GNUC_MINOR__<2)||\
- BOOST_WORKAROUND(__GNUC__, ==7)&&( __cplusplus>=201703L)||\
- BOOST_WORKAROUND(__GNUC__, >=8)&&( __cplusplus>=201103L)||\
- BOOST_WORKAROUND(__clang_major__,>=19)
-/* 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).
- * Clang 19 and later also implement P0522R0 by default.
- * In these cases we resort to an uglier technique, adding defaulted template
- * parameters so as to exceed BOOST_MPL_LIMIT_METAFUNCTION_ARITY.
- */
+namespace boost{
-#include
-#include
-#include
+namespace flyweights{
-#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 detail{
-#else
-#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION ,int=0
-#define BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF ,int
-#endif
+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*
+
+namespace boost{
+
+namespace mpl{
+
+template<
+ template<
+ typename
+ BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
+ > class F,
+ typename T1,
+ typename Tag
+>
+struct lambda<
+ F,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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
diff --git a/include/boost/flyweight/hashed_factory.hpp b/include/boost/flyweight/hashed_factory.hpp
index c0221dd..899eb61 100644
--- a/include/boost/flyweight/hashed_factory.hpp
+++ b/include/boost/flyweight/hashed_factory.hpp
@@ -103,7 +103,7 @@ class hashed_factory_class:public factory_marker
template<
typename Hash,typename Pred,typename Allocator
- ,int//BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
+ BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION_DEF
>
struct hashed_factory:factory_marker
{
diff --git a/include/boost/flyweight/hashed_factory_fwd.hpp b/include/boost/flyweight/hashed_factory_fwd.hpp
index e609366..a934118 100644
--- a/include/boost/flyweight/hashed_factory_fwd.hpp
+++ b/include/boost/flyweight/hashed_factory_fwd.hpp
@@ -29,8 +29,7 @@ class hashed_factory_class;
template<
typename Hash=mpl::na,typename Pred=mpl::na,typename Allocator=mpl::na
- ,int=666
- //BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION
+ BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION
>
struct hashed_factory;
@@ -38,20 +37,4 @@ struct hashed_factory;
} /* namespace boost */
-namespace boost{
-namespace mpl{
-
-template<
- template class F,
- typename H,typename P,typename A,
- typename Tag
->
-struct lambda,Tag>
-{
- typedef F type;
-};
-
-}
-}
-
#endif
From e2a8fa08591399d959abd14084f3b89b3b37b0be Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Sat, 20 Sep 2025 11:00:48 +0200
Subject: [PATCH 11/12] documented not_placeholder_expr.hpp machinery
---
.../boost/flyweight/detail/not_placeholder_expr.hpp | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/include/boost/flyweight/detail/not_placeholder_expr.hpp b/include/boost/flyweight/detail/not_placeholder_expr.hpp
index f2176ed..4c59516 100644
--- a/include/boost/flyweight/detail/not_placeholder_expr.hpp
+++ b/include/boost/flyweight/detail/not_placeholder_expr.hpp
@@ -14,9 +14,9 @@
#endif
#include /* keep it first to prevent nasty warns in MSVC */
+#include
#include
#include
-#include
/* BOOST_FLYWEIGHT_NOT_A_PLACEHOLDER_EXPRESSION can be inserted at the end
* of a class template parameter declaration:
@@ -53,6 +53,15 @@ struct not_a_ph_expr;
#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.
+ */
+
namespace boost{
namespace mpl{
From 95390fc5d377a5195d20e8986f660773e207316c Mon Sep 17 00:00:00 2001
From: joaquintides
Date: Sat, 20 Sep 2025 11:47:27 +0200
Subject: [PATCH 12/12] updated release notes
---
doc/release_notes.html | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/doc/release_notes.html b/doc/release_notes.html
index ade6710..1f76be0 100644
--- a/doc/release_notes.html
+++ b/doc/release_notes.html
@@ -31,6 +31,7 @@
+
+ - Fixed compile errors in Clang 19 and later due to
+ P0522R0 support.
+
+
+
Boost 1.87 release
@@ -257,9 +267,9 @@
Boost 1.38 release
-Revised September 29th 2024
+Revised September 20th 2025
-© Copyright 2006-2024 Joaquín M López Muñoz.
+
© Copyright 2006-2025 Joaquín M López Muñoz.
Distributed under the Boost Software
License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at