mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-07 15:08:22 +01:00
Squashed 'externals/mp/' content from commit 29cb5588d
git-subtree-dir: externals/mp git-subtree-split: 29cb5588da3a18ed571a0e41622900a01b9f01eb
This commit is contained in:
commit
7b0c47d3f0
30 changed files with 971 additions and 0 deletions
16
include/mp/metavalue/lift_value.h
Normal file
16
include/mp/metavalue/lift_value.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* This file is part of the mp project.
|
||||
* Copyright (c) 2017 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace mp {
|
||||
|
||||
/// Lifts a value into a type (a metavalue)
|
||||
template<auto V>
|
||||
using lift_value = std::integral_constant<decltype(V), V>;
|
||||
|
||||
} // namespace mp
|
||||
16
include/mp/metavalue/value_cast.h
Normal file
16
include/mp/metavalue/value_cast.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* This file is part of the mp project.
|
||||
* Copyright (c) 2017 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace mp {
|
||||
|
||||
/// Casts a metavalue from one type to another
|
||||
template<class T, class V>
|
||||
using value_cast = std::integral_constant<T, static_cast<T>(V::value)>;
|
||||
|
||||
} // namespace mp
|
||||
16
include/mp/metavalue/value_equal.h
Normal file
16
include/mp/metavalue/value_equal.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* This file is part of the mp project.
|
||||
* Copyright (c) 2020 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace mp {
|
||||
|
||||
/// Do two metavalues contain the same value?
|
||||
template<class V1, class V2>
|
||||
using value_equal = std::bool_constant<V1::value == V2::value>;
|
||||
|
||||
} // namespace mp
|
||||
Loading…
Add table
Add a link
Reference in a new issue