Created
June 4, 2022 01:12
-
-
Save uemuraj/0c664fa02f3b8be48dcd8bc8a4d6b4a8 to your computer and use it in GitHub Desktop.
複数の値を返す何か。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pch.h" | |
#include <algorithm> | |
#include <initializer_list> | |
struct | |
{ | |
long min; | |
long max; | |
} | |
Calc(std::initializer_list<long> values) | |
{ | |
return { std::min(values), std::max(values) }; | |
} | |
TEST(TestCaseName, TestName) | |
{ | |
auto res = Calc({1,2,3,4,5}); | |
EXPECT_EQ(1, res.min); | |
EXPECT_EQ(5, res.max); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Visual Studio 2019 ではコンパイルも実行もできるが...