26 m_names { other.m_names } {}
30 inline bool hasSemantic(
const SemanticName& name )
const {
31 return m_names.find( name ) != m_names.end();
34 inline const SemanticNameCollection& semantics()
const {
return m_names; }
38 CORE_ASSERT( m_names == other.m_names,
"Try to assign object with different semantics" );
41 inline ObjectWithSemantic& operator=( ObjectWithSemantic&& other ) {
43 CORE_ASSERT( m_names == other.m_names,
"Try to assign object with different semantics" );
47 inline bool shareSemantic(
const ObjectWithSemantic& other )
const {
48 return std::any_of( m_names.begin(), m_names.end(), [&other](
const auto& s ) {
49 return other.hasSemantic( s );
53 inline bool sameSemantics(
const ObjectWithSemantic& other )
const {
54 return m_names == other.m_names;
58 template <
class... SemanticNames>
59 inline explicit ObjectWithSemantic( SemanticNames... names ) : m_names { names... } {}
61 inline explicit ObjectWithSemantic(
const SemanticNameCollection& otherNames ) :
62 m_names { otherNames } {}
65 SemanticNameCollection m_names;