Skip to content

Constrained relational operators in line with P2944R3#61

Open
joaquintides wants to merge 10 commits into
boostorg:developfrom
joaquintides:feature/constrained-relops
Open

Constrained relational operators in line with P2944R3#61
joaquintides wants to merge 10 commits into
boostorg:developfrom
joaquintides:feature/constrained-relops

Conversation

@joaquintides

Copy link
Copy Markdown
Member

Closes #60. Observations:

  • The constraints are not 1:1 with those of std::variant because Boost.Variant2 implements operator>/operator>= in terms of operator</operator<=.
  • For compilers without expression SFINAE support, constraint checking does not work if any of the corresponding Ti's relops is deleted: in this case, variant's relop fails to instantiate (as before this PR). This limitation is not documented in the reference.

@pdimov

pdimov commented Jul 18, 2026

Copy link
Copy Markdown
Member

What C++11 compiler defines BOOST_NO_SFINAE_EXPR?

@joaquintides

Copy link
Copy Markdown
Member Author

Good question. I got the check from here. According to Claude, the C++11 compilers with BOOST_NO_SFINAE_EXPR are:

  • Unconditionally
    • Metrowerks/CodeWarrior
    • GCC-XML
    • PathScale EKOPath
    • MPW MrCpp/SCpp
    • HP aCC
    • Borland C++
    • Digital Mars
    • CodeGear/Embarcadero
    • IBM VisualAge / XL C++ (AIX)
    • IBM XL C++ for z/OS
    • common_edg.hpp
    • Intel on WIndows
  • Conditionally
    • GCC < 4.5
    • Visual Studio with _MSC_FULL_VER < 190024210
    • Oracle/Sun Studio before 12.4
    • Cray < 8.5
    • Intel on Linux/macOS <12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with unconstrained relational operators in C++26

2 participants