diff options
-rw-r--r-- | .github/workflows/ci.yml | 17 | ||||
-rw-r--r-- | include/cru/common/Format.hpp | 13 |
2 files changed, 15 insertions, 15 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e54bbcf2..e99fc8b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Build run: | - cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++ -H. -B./build -G Ninja + cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -H. -B./build -G Ninja cmake --build ./build --config Debug --target all - name: Test @@ -59,11 +59,12 @@ jobs: with: version: 1.10.2 - - name: Run build script - shell: pwsh + - name: Build run: | - . ./tools/Use-VC.ps1 - Use-VC - mkdir build && cd build - cmake .. -G Ninja -DCMAKE_BUILD_TYPE:STRING=Debug - ninja all + cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -H. -B./build -G Ninja + cmake --build ./build --config Debug --target all + + - name: Test + working-directory: build + run: | + ctest -C Debug -T test --output-on-failure diff --git a/include/cru/common/Format.hpp b/include/cru/common/Format.hpp index d53a5720..c093c9e6 100644 --- a/include/cru/common/Format.hpp +++ b/include/cru/common/Format.hpp @@ -2,6 +2,7 @@ #include "Exception.hpp" #include "String.hpp" +#include "cru/common/Base.hpp" namespace cru { inline String ToString(bool value) { @@ -32,16 +33,14 @@ std::enable_if_t<std::is_floating_point_v<T>, String> ToString(T value) { return String(str.cbegin(), str.cend()); } +inline String ToString(String value) { return value; } + template <typename T> -std::enable_if_t< - std::is_convertible_v<decltype(ToString(std::declval<const T&>)), String>, - String> -ToString(const T& value, StringView option) { - return ToString(value); +String ToString(T&& value, StringView option) { + CRU_UNUSED(option) + return ToString(std::forward<T>(value)); } -inline String ToString(String value) { return value; } - namespace details { enum class FormatTokenType { PlaceHolder, Text }; enum class FormatPlaceHolderType { None, Positioned, Named }; |