cpp-common/bt2c/fmt.hpp: use `wise_enum::string_type` in `EnableIfIsWiseEnum` definition
[babeltrace.git] / src / cpp-common / bt2c / align.hpp
1 /*
2 * Copyright (c) 2022 Philippe Proulx <pproulx@efficios.com>
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7 #ifndef BABELTRACE_CPP_COMMON_BT2C_ALIGN_HPP
8 #define BABELTRACE_CPP_COMMON_BT2C_ALIGN_HPP
9
10 #include <type_traits>
11
12 #include "common/align.h"
13
14 namespace bt2c {
15
16 template <typename ValT, typename AlignT>
17 ValT align(const ValT val, const AlignT align) noexcept
18 {
19 static_assert(std::is_unsigned<ValT>::value, "`ValT` is unsigned.");
20 return BT_ALIGN(val, static_cast<ValT>(align));
21 }
22
23 } /* namespace bt2c */
24
25 #endif /* BABELTRACE_CPP_COMMON_BT2C_ALIGN_HPP */
This page took 0.031099 seconds and 4 git commands to generate.