dynarmic/include/mp/metavalue/logic_if.h
MerryMage 1925d4dcc6 Squashed 'externals/mp/' changes from 29cb5588d..649fde1e8
649fde1e8 typelist: Add drop
5efe868da travis: Drop GCC 7 from CI
c3f890f17 Update to use new metavalue types
c4dd1c9b9 metavalue: Add some common operations
7da45c71b Remove unnecessary public keyword for struct inheritance
287d8e7ec Correct typos in file headers

git-subtree-dir: externals/mp
git-subtree-split: 649fde1e814f9ce5b04d7ddeb940244d9f63cb2f
2020-04-22 21:06:56 +01:00

21 lines
562 B
C++

/* This file is part of the mp project.
* Copyright (c) 2020 MerryMage
* SPDX-License-Identifier: 0BSD
*/
#pragma once
#include <type_traits>
#include <mp/metavalue/value.h>
namespace mp {
/// Conditionally select between types T and F based on boolean metavalue V
template<class V, class T, class F>
using logic_if = std::conditional_t<bool(V::value), T, F>;
/// Conditionally select between metavalues T and F based on boolean metavalue V
template<class V, class TV, class FV>
constexpr auto logic_if_v = logic_if<V, TV, FV>::value;
} // namespace mp