Merge pull request #51 from mrexodia/register_desc

Add implicit conversion from enum in register_desc
This commit is contained in:
Can Bölük 2020-11-16 21:24:56 +01:00 committed by GitHub
commit eeffb26b8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View file

@ -12,7 +12,7 @@ FetchContent_Declare(
capstone
GIT_REPOSITORY https://github.com/aquynh/capstone
GIT_TAG d71c95b09b1fa478c0ab9294b07fd6f2efaa1b31
GIT_SHALLOW true
GIT_SHALLOW false
)
FetchContent_MakeAvailable(capstone)

View file

@ -3,7 +3,7 @@ FetchContent_Declare(
keystone
GIT_REPOSITORY https://github.com/keystone-engine/keystone
GIT_TAG e1547852d9accb9460573eb156fc81645b8e1871
GIT_SHALLOW true
GIT_SHALLOW false
)
FetchContent_GetProperties(keystone)

View file

@ -166,6 +166,9 @@ namespace vtil
is_valid( true );
}
template<Enum T>
register_desc( T v ) : register_desc( register_cast<T>()( v ) ) { }
// Returns whether the descriptor is valid or not.
//
constexpr bool is_valid( bool force = false ) const