Function registerEnum

Summary

#include <include/internal/catch_interfaces_enum_values_registry.h>

(1) virtual Detail::EnumInfo const  & registerEnum(StringRef enumName, StringRef allEnums, std::vector< int > const &values)=0

(2) template <typename E>
    Detail::EnumInfo const  & registerEnum(StringRef enumName, StringRef allEnums, std::initializer_list< E > values)

Function overload

Synopsis

#include <include/internal/catch_interfaces_enum_values_registry.h>

virtual Detail::EnumInfo const  & registerEnum(StringRef enumName, StringRef allEnums, std::vector< int > const &values)=0

Description

No description yet.

Source

Line 31 in include/internal/catch_interfaces_enum_values_registry.h.

Synopsis

#include <include/internal/catch_interfaces_enum_values_registry.h>

template <typename E>
Detail::EnumInfo const  & registerEnum(StringRef enumName, StringRef allEnums, std::initializer_list< E > values)

Description

No description yet.

Source

Lines 33-41 in include/internal/catch_interfaces_enum_values_registry.h.

template<typename E>
Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::initializer_list<E> values ) {
    static_assert(sizeof(int) >= sizeof(E), "Cannot serialize enum to int");
    std::vector<int> intValues;
    intValues.reserve( values.size() );
    for( auto enumValue : values )
        intValues.push_back( static_cast<int>( enumValue ) );
    return registerEnum( enumName, allEnums, intValues );
}





Add Discussion as Guest

Log in