Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sean McBride
VTK
Commits
aaeffce2
Commit
aaeffce2
authored
1 month ago
by
Jaswant Panchumarti (Kitware)
Browse files
Options
Downloads
Patches
Plain Diff
Support std::string_view in vtkOStreamWrapper
parent
232dd5b5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/Core/vtkOStreamWrapper.cxx
+7
-0
7 additions, 0 deletions
Common/Core/vtkOStreamWrapper.cxx
Common/Core/vtkOStreamWrapper.h
+9
-0
9 additions, 0 deletions
Common/Core/vtkOStreamWrapper.h
with
16 additions
and
0 deletions
Common/Core/vtkOStreamWrapper.cxx
+
7
−
0
View file @
aaeffce2
...
...
@@ -81,6 +81,13 @@ vtkOStreamWrapper& vtkOStreamWrapper::operator<<(std_string const& s)
return
*
this
;
}
//------------------------------------------------------------------------------
vtkOStreamWrapper
&
vtkOStreamWrapper
::
operator
<<
(
std_string_view
const
&
s
)
{
this
->
ostr
<<
reinterpret_cast
<
std
::
string_view
const
&>
(
s
);
return
*
this
;
}
//------------------------------------------------------------------------------
#if defined(__IBMCPP__)
vtkOStreamWrapper
&
vtkOStreamWrapper
::
WriteInternal
(
const
char
*
a
)
...
...
This diff is collapsed.
Click to expand it.
Common/Core/vtkOStreamWrapper.h
+
9
−
0
View file @
aaeffce2
...
...
@@ -33,6 +33,7 @@ class vtkStdString;
class
VTKCOMMONCORE_EXPORT
VTK_WRAPEXCLUDE
vtkOStreamWrapper
{
class
std_string
;
class
std_string_view
;
public:
///@{
...
...
@@ -114,6 +115,13 @@ public:
return
*
this
;
}
// Accept std::string_view without a declaration.
template
<
template
<
typename
,
typename
>
class
SV
>
vtkOStreamWrapper
&
operator
<<
(
const
SV
<
char
,
std
::
char_traits
<
char
>>&
sv
)
{
return
*
this
<<
reinterpret_cast
<
std_string_view
const
&>
(
sv
);
}
/**
* Forward the write method to the real stream.
*/
...
...
@@ -155,6 +163,7 @@ protected:
private
:
vtkOStreamWrapper
&
operator
=
(
const
vtkOStreamWrapper
&
r
)
=
delete
;
vtkOStreamWrapper
&
operator
<<
(
std_string
const
&
);
vtkOStreamWrapper
&
operator
<<
(
std_string_view
const
&
);
};
VTK_ABI_NAMESPACE_END
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment