Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
a39bf375
Commit
a39bf375
authored
Oct 18, 2018
by
Paul
Browse files
Add a default print using reflect
parent
6c375c50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
src/include/migraph/operation.hpp
src/include/migraph/operation.hpp
+10
-1
tools/include/operation.hpp
tools/include/operation.hpp
+9
-1
No files found.
src/include/migraph/operation.hpp
View file @
a39bf375
...
...
@@ -54,7 +54,16 @@ namespace operation_stream {
template
<
class
T
>
auto
operator
<<
(
std
::
ostream
&
os
,
const
T
&
x
)
->
decltype
(
os
<<
x
.
name
())
{
return
os
<<
x
.
name
();
os
<<
x
.
name
();
char
delim
=
'['
;
reflect_each
(
x
,
[
&
](
auto
&
y
,
auto
name
,
auto
&&
...)
{
os
<<
delim
;
os
<<
name
<<
"="
<<
y
;
delim
=
','
;
});
if
(
delim
==
','
)
os
<<
"]"
;
return
os
;
}
}
// namespace operation_stream
...
...
tools/include/operation.hpp
View file @
a39bf375
...
...
@@ -54,7 +54,15 @@ namespace operation_stream {
template
<
class
T
>
auto
operator
<<
(
std
::
ostream
&
os
,
const
T
&
x
)
->
decltype
(
os
<<
x
.
name
())
{
return
os
<<
x
.
name
();
os
<<
x
.
name
();
char
delim
=
'['
;
reflect_each
(
x
,
[
&
](
auto
&
y
,
auto
name
,
auto
&&
...)
{
os
<<
delim
;
os
<<
name
<<
"="
<<
y
;
delim
=
','
;
});
if
(
delim
==
','
)
os
<<
"]"
;
return
os
;
}
}
// namespace operation_stream
...
...
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