PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
arithmetic_type_name.hpp
Go to the documentation of this file.
1 
12 #ifndef PLSSVM_DETAIL_ARITHMETIC_TYPE_NAME_HPP_
13 #define PLSSVM_DETAIL_ARITHMETIC_TYPE_NAME_HPP_
14 #pragma once
15 
16 #include <string_view> // std::string_view
17 
23 #define PLSSVM_CREATE_ARITHMETIC_TYPE_NAME(type) \
24  template <> \
25  [[nodiscard]] constexpr inline std::string_view arithmetic_type_name<type>() { return #type; } \
26  template <> \
27  [[nodiscard]] constexpr inline std::string_view arithmetic_type_name<const type>() { return "const " #type; } \
28  template <> \
29  [[nodiscard]] constexpr inline std::string_view arithmetic_type_name<volatile type>() { return "volatile " #type; } \
30  template <> \
31  [[nodiscard]] constexpr inline std::string_view arithmetic_type_name<const volatile type>() { return "const volatile " #type; }
32 
33 namespace plssvm::detail {
34 
41 template <typename T>
42 [[nodiscard]] constexpr inline std::string_view arithmetic_type_name() = delete;
43 
45 
46 // character types
53 
54 // integer types
62 PLSSVM_CREATE_ARITHMETIC_TYPE_NAME(unsigned long long)
63 
64 // floating point types
68 
69 } // namespace plssvm::detail
70 
71 #undef PLSSVM_CREATE_ARITHMETIC_TYPE_NAME
72 
73 #endif // PLSSVM_DETAIL_ARITHMETIC_TYPE_NAME_HPP_
#define PLSSVM_CREATE_ARITHMETIC_TYPE_NAME(type)
Defines a macro to create all possible conversion functions from arithmetic types to their name as st...
Definition: arithmetic_type_name.hpp:23
Namespace containing implementation details. Should not directly be used by users.
Definition: csvm.hpp:27
constexpr std::string_view arithmetic_type_name()=delete
Tries to convert the given type to its name as string representation including possible const and/or ...