Apply clang-format/cmake-format

This commit is contained in:
Martchus 2023-02-03 13:31:18 +01:00
parent be6626f6a6
commit 7d6fc9721a
4 changed files with 21 additions and 18 deletions

View File

@ -7,8 +7,8 @@
#include <functional> #include <functional>
#include <initializer_list> #include <initializer_list>
#include <limits> #include <limits>
#include <vector>
#include <tuple> #include <tuple>
#include <vector>
#ifdef CPP_UTILITIES_DEBUG_BUILD #ifdef CPP_UTILITIES_DEBUG_BUILD
#include <cassert> #include <cassert>
#endif #endif

View File

@ -43,14 +43,18 @@ if (NOT META_NO_CPP_UNIT)
if (NOT CPP_UNIT_LIB AND NOT CPP_UNIT_INCLUDE_DIR) if (NOT CPP_UNIT_LIB AND NOT CPP_UNIT_INCLUDE_DIR)
find_package(CppUnit CONFIG) find_package(CppUnit CONFIG)
if (TARGET CppUnit) if (TARGET CppUnit)
set(CPP_UNIT_LIB CppUnit CACHE STRING "CppUnit target" FORCE) set(CPP_UNIT_LIB
CppUnit
CACHE STRING "CppUnit target" FORCE)
endif () endif ()
endif () endif ()
# fall back to find_library # fall back to find_library
if (NOT CPP_UNIT_LIB AND NOT CPP_UNIT_INCLUDE_DIR) if (NOT CPP_UNIT_LIB AND NOT CPP_UNIT_INCLUDE_DIR)
find_library(DETECTED_CPP_UNIT_LIB cppunit) find_library(DETECTED_CPP_UNIT_LIB cppunit)
set(CPP_UNIT_LIB "${DETECTED_CPP_UNIT_LIB}" CACHE FILEPATH "CppUnit library" FORCE) set(CPP_UNIT_LIB
"${DETECTED_CPP_UNIT_LIB}"
CACHE FILEPATH "CppUnit library" FORCE)
endif () endif ()
if (NOT CPP_UNIT_LIB) if (NOT CPP_UNIT_LIB)

View File

@ -266,9 +266,9 @@ template <class StringType = std::string, class... Args> inline StringType argsT
* \brief Allows construction of string-tuples via %-operator, eg. string1 % "string2" % string3. * \brief Allows construction of string-tuples via %-operator, eg. string1 % "string2" % string3.
*/ */
template <class Tuple, class StringType, template <class Tuple, class StringType,
Traits::EnableIf<Traits::IsSpecializationOf<Tuple, std::tuple>, Traits::IsSpecializingAnyOf<StringType, std::basic_string, std::basic_string_view>> Traits::EnableIf<Traits::IsSpecializationOf<Tuple, std::tuple>,
* = nullptr> Traits::IsSpecializingAnyOf<StringType, std::basic_string, std::basic_string_view>> * = nullptr>
constexpr auto operator%(const Tuple &lhs, const StringType &rhs) -> decltype(std::tuple_cat(lhs, std::tuple<const StringType&>(rhs))) constexpr auto operator%(const Tuple &lhs, const StringType &rhs) -> decltype(std::tuple_cat(lhs, std::tuple<const StringType &>(rhs)))
{ {
return std::tuple_cat(lhs, std::tuple<const StringType &>(rhs)); return std::tuple_cat(lhs, std::tuple<const StringType &>(rhs));
} }
@ -276,9 +276,8 @@ constexpr auto operator%(const Tuple &lhs, const StringType &rhs) -> decltype(st
/*! /*!
* \brief Allows construction of string-tuples via %-operator, eg. string1 % "string2" % string3. * \brief Allows construction of string-tuples via %-operator, eg. string1 % "string2" % string3.
*/ */
template <class Tuple, template <class Tuple, Traits::EnableIf<Traits::IsSpecializationOf<Tuple, std::tuple>> * = nullptr>
Traits::EnableIf<Traits::IsSpecializationOf<Tuple, std::tuple>> constexpr auto operator%(const Tuple &lhs, const char *rhs) -> decltype(std::tuple_cat(lhs, std::tuple<const char *>(rhs)))
* = nullptr > constexpr auto operator%(const Tuple &lhs, const char *rhs) -> decltype(std::tuple_cat(lhs, std::tuple<const char*>(rhs)))
{ {
return std::tuple_cat(lhs, std::tuple<const char *>(rhs)); return std::tuple_cat(lhs, std::tuple<const char *>(rhs));
} }
@ -286,7 +285,8 @@ template <class Tuple,
/*! /*!
* \brief Allows construction of string-tuples via %-operator, eg. string1 % "string2" % string3. * \brief Allows construction of string-tuples via %-operator, eg. string1 % "string2" % string3.
*/ */
template <class Tuple, typename IntegralType, Traits::EnableIf<Traits::IsSpecializationOf<Tuple, std::tuple>, std::is_integral<IntegralType>> * = nullptr> template <class Tuple, typename IntegralType,
Traits::EnableIf<Traits::IsSpecializationOf<Tuple, std::tuple>, std::is_integral<IntegralType>> * = nullptr>
constexpr auto operator%(const Tuple &lhs, IntegralType rhs) -> decltype(std::tuple_cat(lhs, std::tuple<IntegralType>(rhs))) constexpr auto operator%(const Tuple &lhs, IntegralType rhs) -> decltype(std::tuple_cat(lhs, std::tuple<IntegralType>(rhs)))
{ {
return std::tuple_cat(lhs, std::tuple<IntegralType>(rhs)); return std::tuple_cat(lhs, std::tuple<IntegralType>(rhs));
@ -298,7 +298,7 @@ constexpr auto operator%(const Tuple &lhs, IntegralType rhs) -> decltype(std::tu
template <class StringType, template <class StringType,
Traits::EnableIfAny<Traits::IsSpecializationOf<StringType, std::basic_string>, Traits::IsSpecializationOf<StringType, std::basic_string_view>> Traits::EnableIfAny<Traits::IsSpecializationOf<StringType, std::basic_string>, Traits::IsSpecializationOf<StringType, std::basic_string_view>>
* = nullptr> * = nullptr>
constexpr auto operator%(const StringType &lhs, const StringType &rhs) -> decltype(std::tuple<const StringType&, const StringType&>(lhs, rhs)) constexpr auto operator%(const StringType &lhs, const StringType &rhs) -> decltype(std::tuple<const StringType &, const StringType &>(lhs, rhs))
{ {
return std::tuple<const StringType &, const StringType &>(lhs, rhs); return std::tuple<const StringType &, const StringType &>(lhs, rhs);
} }
@ -309,7 +309,7 @@ constexpr auto operator%(const StringType &lhs, const StringType &rhs) -> declty
template <class StringType, template <class StringType,
Traits::EnableIfAny<Traits::IsSpecializationOf<StringType, std::basic_string>, Traits::IsSpecializationOf<StringType, std::basic_string_view>> Traits::EnableIfAny<Traits::IsSpecializationOf<StringType, std::basic_string>, Traits::IsSpecializationOf<StringType, std::basic_string_view>>
* = nullptr> * = nullptr>
constexpr auto operator%(const char *lhs, const StringType &rhs) -> decltype(std::tuple<const char*, const StringType&>(lhs, rhs)) constexpr auto operator%(const char *lhs, const StringType &rhs) -> decltype(std::tuple<const char *, const StringType &>(lhs, rhs))
{ {
return std::tuple<const char *, const StringType &>(lhs, rhs); return std::tuple<const char *, const StringType &>(lhs, rhs);
} }
@ -320,7 +320,7 @@ constexpr auto operator%(const char *lhs, const StringType &rhs) -> decltype(std
template <class StringType, template <class StringType,
Traits::EnableIfAny<Traits::IsSpecializationOf<StringType, std::basic_string>, Traits::IsSpecializationOf<StringType, std::basic_string_view>> Traits::EnableIfAny<Traits::IsSpecializationOf<StringType, std::basic_string>, Traits::IsSpecializationOf<StringType, std::basic_string_view>>
* = nullptr> * = nullptr>
constexpr auto operator%(const StringType &lhs, const char *rhs) -> decltype(std::tuple<const StringType&, const char*>(lhs, rhs)) constexpr auto operator%(const StringType &lhs, const char *rhs) -> decltype(std::tuple<const StringType &, const char *>(lhs, rhs))
{ {
return std::tuple<const StringType &, const char *>(lhs, rhs); return std::tuple<const StringType &, const char *>(lhs, rhs);
} }
@ -331,7 +331,7 @@ constexpr auto operator%(const StringType &lhs, const char *rhs) -> decltype(std
template <class StringType, template <class StringType,
Traits::EnableIfAny<Traits::IsSpecializationOf<StringType, std::basic_string>, Traits::IsSpecializationOf<StringType, std::basic_string_view>> Traits::EnableIfAny<Traits::IsSpecializationOf<StringType, std::basic_string>, Traits::IsSpecializationOf<StringType, std::basic_string_view>>
* = nullptr> * = nullptr>
constexpr auto operator%(const StringType &lhs, char rhs) -> decltype(std::tuple<const StringType&, char>(lhs, rhs)) constexpr auto operator%(const StringType &lhs, char rhs) -> decltype(std::tuple<const StringType &, char>(lhs, rhs))
{ {
return std::tuple<const StringType &, char>(lhs, rhs); return std::tuple<const StringType &, char>(lhs, rhs);
} }
@ -342,7 +342,7 @@ constexpr auto operator%(const StringType &lhs, char rhs) -> decltype(std::tuple
template <class StringType, template <class StringType,
Traits::EnableIfAny<Traits::IsSpecializationOf<StringType, std::basic_string>, Traits::IsSpecializationOf<StringType, std::basic_string_view>> Traits::EnableIfAny<Traits::IsSpecializationOf<StringType, std::basic_string>, Traits::IsSpecializationOf<StringType, std::basic_string_view>>
* = nullptr> * = nullptr>
constexpr auto operator%(char lhs, const StringType &rhs) -> decltype(std::tuple<char, const StringType&>(lhs, rhs)) constexpr auto operator%(char lhs, const StringType &rhs) -> decltype(std::tuple<char, const StringType &>(lhs, rhs))
{ {
return std::tuple<char, const StringType &>(lhs, rhs); return std::tuple<char, const StringType &>(lhs, rhs);
} }

View File

@ -255,9 +255,8 @@ WideStringData convertMultiByteToWide(std::error_code &ec, const char *inputBuff
*/ */
WideStringData convertMultiByteToWide(std::error_code &ec, const std::string &inputBuffer) WideStringData convertMultiByteToWide(std::error_code &ec, const std::string &inputBuffer)
{ {
return convertMultiByteToWide(ec, inputBuffer.data(), inputBuffer.size() < static_cast<std::size_t>(std::numeric_limits<int>::max() - 1) return convertMultiByteToWide(ec, inputBuffer.data(),
? static_cast<int>(inputBuffer.size() + 1) inputBuffer.size() < static_cast<std::size_t>(std::numeric_limits<int>::max() - 1) ? static_cast<int>(inputBuffer.size() + 1) : -1);
: -1);
} }
/*! /*!