Skip to content

fix: resolve clang >= 17 compilation error in extract<const T>()#623

Open
jschueller wants to merge 1 commit into
esa:masterfrom
jschueller:issue584
Open

fix: resolve clang >= 17 compilation error in extract<const T>()#623
jschueller wants to merge 1 commit into
esa:masterfrom
jschueller:issue584

Conversation

@jschueller

Copy link
Copy Markdown
Contributor

The non-const get_ptr() in UDx inner classes tries to return &m_value as void*, but when T is const-qualified this drops const without an explicit cast, which clang >= 17 rejects. Use std::remove_const_t for the m_value member so &m_value is always a non-const pointer. This avoids const_cast entirely and applies uniformly across all UDx types (island, problem, algorithm, topology, bfe, s_policy, r_policy).

Closes #584.

The non-const get_ptr() in UDx inner classes tries to return &m_value as
void*, but when T is const-qualified this drops const without an explicit
cast, which clang >= 17 rejects. Use std::remove_const_t<T> for the m_value
member so &m_value is always a non-const pointer. This avoids const_cast
entirely and applies uniformly across all UDx types (island, problem,
algorithm, topology, bfe, s_policy, r_policy).

Closes esa#584.
@jschueller jschueller marked this pull request as ready for review May 21, 2026 07:41
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.

[BUG] island.hpp:226:16: error: cannot initialize return object of type 'void *'

1 participant