-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an odr violation in ranges.h (#2483)
* Add a testcase demonstrating ODR violation in ranges.h * Fix ODR violation in ranges.h * Fix comments Co-authored-by: Pierre-Antoine Lacaze <[email protected]>
- Loading branch information
Showing
3 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Formatting library for C++ - the core API | ||
// | ||
// Copyright (c) 2012 - present, Victor Zverovich | ||
// All rights reserved. | ||
// | ||
// For the license information refer to format.h. | ||
|
||
#include "fmt/ranges.h" | ||
|
||
#include <vector> | ||
|
||
#include "gtest/gtest.h" | ||
|
||
// call fmt::format from another translation unit to test ODR | ||
TEST(ranges_odr_test, format_vector) { | ||
auto v = std::vector<int>{1, 2, 3, 5, 7, 11}; | ||
EXPECT_EQ(fmt::format("{}", v), "[1, 2, 3, 5, 7, 11]"); | ||
} | ||
|