Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
d306585a
Commit
d306585a
authored
Apr 17, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't inject internal names into std (#1120)
parent
544b9279
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
include/fmt/format.h
include/fmt/format.h
+4
-1
test/format-test.cc
test/format-test.cc
+5
-0
No files found.
include/fmt/format.h
View file @
d306585a
...
...
@@ -257,9 +257,12 @@ namespace internal {
#endif
// A fallback implementation of uintptr_t for systems that lack it.
namespace
uintptr
{
struct
uintptr_t
{
unsigned
char
value
[
sizeof
(
void
*
)];
};
}
using
uintptr
::
uintptr_t
;
typedef
std
::
numeric_limits
<
uintptr_t
>
numutil
;
template
<
typename
T
>
inline
bool
use_grisu
()
{
...
...
@@ -312,7 +315,7 @@ typename Allocator::value_type* allocate(Allocator& alloc, std::size_t n) {
FMT_END_NAMESPACE
namespace
std
{
using
namespace
fmt
::
v5
::
internal
;
using
namespace
fmt
::
v5
::
internal
::
uintptr
;
// Standard permits specialization of std::numeric_limits. This specialization
// is used to detect presence of uintptr_t.
template
<
>
...
...
test/format-test.cc
View file @
d306585a
...
...
@@ -2540,6 +2540,11 @@ TEST(FormatTest, EmphasisNonHeaderOnly) {
}
TEST
(
FormatTest
,
CharTraitsIsNotAmbiguous
)
{
// Test that we don't inject internal names into the std namespace.
using
namespace
std
;
char_traits
<
char
>::
char_type
c
;
#if __cplusplus >= 201103L
std
::
string
s
;
begin
(
s
);
#endif
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment