You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
371 B
C++

// SPDX-License-Identifier: BSD-2-Clause
// author: Max Kellermann <max.kellermann@gmail.com>
#pragma once
#include <type_traits>
/**
* Generate a type based on #To with the same const-ness as #From.
*/
template<typename To, typename From>
using CopyConst = std::conditional_t<std::is_const_v<From>,
std::add_const_t<To>,
std::remove_const_t<To>>;