Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenVolumeMesh
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenVolumeMesh
OpenVolumeMesh
Commits
41b6662b
Commit
41b6662b
authored
Dec 03, 2015
by
Max Lyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix serializer bug, now really
parent
ad338546
Pipeline
#230
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
src/OpenVolumeMesh/Core/SerializersT.cc
src/OpenVolumeMesh/Core/SerializersT.cc
+11
-6
No files found.
src/OpenVolumeMesh/Core/SerializersT.cc
View file @
41b6662b
...
...
@@ -44,8 +44,6 @@
#include "Serializers.hh"
namespace
OpenVolumeMesh
{
...
...
@@ -64,7 +62,7 @@ template <typename Stream, typename T>
class
has_input_operator
{
private:
template
<
class
U
>
static
true_type
test
(
char
(
*
)[
sizeof
(
decllval
<
Stream
>
()
>>
decllval
<
U
>
())]);
template
<
class
U
>
static
true_type
test
(
char
(
*
)[
sizeof
(
decllval
<
Stream
>
()
>>
decllval
<
U
>
()
,
void
(),
0
)]);
template
<
class
U
>
static
false_type
test
(...);
public:
...
...
@@ -73,11 +71,15 @@ public:
static
type
value
;
};
template
<
typename
Stream
,
typename
T
>
typename
has_input_operator
<
Stream
,
T
>::
type
has_input_operator
<
Stream
,
T
>::
value
=
typename
has_input_operator
<
Stream
,
T
>::
type
();
template
<
typename
Stream
,
typename
T
>
class
has_output_operator
{
private:
template
<
class
U
>
static
true_type
test
(
char
(
*
)[
sizeof
(
decllval
<
Stream
>
()
<<
decllval
<
U
>
())]);
template
<
class
U
>
static
true_type
test
(
char
(
*
)[
sizeof
(
decllval
<
Stream
>
()
<<
decllval
<
U
>
()
,
void
(),
0
)]);
template
<
class
U
>
static
false_type
test
(...);
public:
...
...
@@ -86,6 +88,9 @@ public:
static
type
value
;
};
template
<
typename
Stream
,
typename
T
>
typename
has_output_operator
<
Stream
,
T
>::
type
has_output_operator
<
Stream
,
T
>::
value
=
typename
has_output_operator
<
Stream
,
T
>::
type
();
template
<
typename
ValueT
>
std
::
ostream
&
serialize_helper
(
std
::
ostream
&
_ostr
,
ValueT
&
_rhs
,
true_type
)
...
...
@@ -95,7 +100,7 @@ std::ostream& serialize_helper(std::ostream& _ostr, ValueT& _rhs, true_type)
}
template
<
typename
ValueT
>
std
::
ostream
&
serialize_helper
(
std
::
ostream
&
_ostr
,
ValueT
&
_rhs
,
false_type
)
std
::
ostream
&
serialize_helper
(
std
::
ostream
&
_ostr
,
ValueT
&
,
false_type
)
{
std
::
cout
<<
"Warning: trying to serialize a type that does not have a serialize function"
<<
std
::
endl
;
return
_ostr
;
...
...
@@ -116,7 +121,7 @@ std::istream& deserialize_helper(std::istream& _istr, ValueT& _rhs, true_type)
}
template
<
typename
ValueT
>
std
::
istream
&
deserialize_helper
(
std
::
istream
&
_istr
,
ValueT
&
_rhs
,
false_type
)
std
::
istream
&
deserialize_helper
(
std
::
istream
&
_istr
,
ValueT
&
,
false_type
)
{
std
::
cout
<<
"Warning: trying to deserialize a type that does not have a deserialize function"
<<
std
::
endl
;
return
_istr
;
...
...
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