Skip to content

Commit b3bec3b

Browse files
jll63claude
andcommitted
core: align the smart-pointer constructor constraints with the assignments
The three converting constructors listed IsPolymorphic before the constructibility test, the two converting assignments after it. Put the exposition-only traits at the ends in all five, so the rendered clause reads SameSmartPtr && <constructible|assignable> && IsPolymorphic throughout, and the five template parameter lists are spelled and formatted identically. Substitution still short-circuits on SameSmartPtr, so `typename Other::element_type` is only formed for an actual smart pointer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent a9f6df0 commit b3bec3b

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

include/boost/openmethod/core.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,12 +1252,12 @@ class virtual_ptr<
12521252
//! @li @c SmartPtr must be constructible from @c const @c Other&.
12531253
template<
12541254
class Other,
1255-
typename = std::enable_if_t<BOOST_OPENMETHOD_UNLESS_MRDOCS(
1256-
detail::) SameSmartPtr<SmartPtr, Other, Registry>>,
12571255
typename = std::enable_if_t<
12581256
BOOST_OPENMETHOD_UNLESS_MRDOCS(detail::)
1259-
IsPolymorphic<typename Other::element_type, Registry> &&
1260-
std::is_constructible_v<SmartPtr, const Other&>>>
1257+
SameSmartPtr<SmartPtr, Other, Registry> &&
1258+
std::is_constructible_v<SmartPtr, const Other&>>,
1259+
typename = std::enable_if_t<BOOST_OPENMETHOD_UNLESS_MRDOCS(
1260+
detail::) IsPolymorphic<typename Other::element_type, Registry>>>
12611261
virtual_ptr(const Other& other)
12621262
: vp(detail::box_vptr<use_indirect_vptrs>(
12631263
other ? detail::acquire_vptr<Registry>(*other)
@@ -1281,12 +1281,12 @@ class virtual_ptr<
12811281
//! @li @c SmartPtr must be constructible from @c Other&.
12821282
template<
12831283
class Other,
1284-
typename = std::enable_if_t<BOOST_OPENMETHOD_UNLESS_MRDOCS(
1285-
detail::) SameSmartPtr<SmartPtr, Other, Registry>>,
12861284
typename = std::enable_if_t<
12871285
BOOST_OPENMETHOD_UNLESS_MRDOCS(detail::)
1288-
IsPolymorphic<typename Other::element_type, Registry> &&
1289-
std::is_constructible_v<SmartPtr, Other&>>>
1286+
SameSmartPtr<SmartPtr, Other, Registry> &&
1287+
std::is_constructible_v<SmartPtr, Other&>>,
1288+
typename = std::enable_if_t<BOOST_OPENMETHOD_UNLESS_MRDOCS(
1289+
detail::) IsPolymorphic<typename Other::element_type, Registry>>>
12901290
virtual_ptr(Other& other)
12911291
: vp(detail::box_vptr<use_indirect_vptrs>(
12921292
other ? detail::acquire_vptr<Registry>(*other)
@@ -1317,12 +1317,12 @@ class virtual_ptr<
13171317
//! @li @c SmartPtr must be constructible from @c Other&&.
13181318
template<
13191319
class Other,
1320-
typename = std::enable_if_t<BOOST_OPENMETHOD_UNLESS_MRDOCS(
1321-
detail::) SameSmartPtr<SmartPtr, Other, Registry>>,
13221320
typename = std::enable_if_t<
13231321
BOOST_OPENMETHOD_UNLESS_MRDOCS(detail::)
1324-
IsPolymorphic<typename Other::element_type, Registry> &&
1325-
std::is_constructible_v<SmartPtr, Other&&>>>
1322+
SameSmartPtr<SmartPtr, Other, Registry> &&
1323+
std::is_constructible_v<SmartPtr, Other&&>>,
1324+
typename = std::enable_if_t<BOOST_OPENMETHOD_UNLESS_MRDOCS(
1325+
detail::) IsPolymorphic<typename Other::element_type, Registry>>>
13261326
virtual_ptr(Other&& other)
13271327
: vp(detail::box_vptr<use_indirect_vptrs>(
13281328
other ? detail::acquire_vptr<Registry>(*other)

0 commit comments

Comments
 (0)