Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Robert Sachunsky
olena
Commits
e69979da
Commit
e69979da
authored
Mar 14, 2011
by
Guillaume Lazzara
Browse files
Add more from_to overloards.
* mln/convert/impl/from_unsigned_to_value.hh, * mln/value/label.hh: Here.
parent
bed27157
Changes
3
Hide whitespace changes
Inline
Side-by-side
milena/ChangeLog
View file @
e69979da
2011-03-14 Guillaume Lazzara <z@lrde.epita.fr>
Add more from_to overloards.
* mln/convert/impl/from_unsigned_to_value.hh,
* mln/value/label.hh: Here.
2011-03-01 Guillaume Lazzara <z@lrde.epita.fr>
* mln/labeling/fill_holes.hh: Improve speed.
milena/mln/convert/impl/from_unsigned_to_value.hh
View file @
e69979da
// Copyright (C) 2009, 2010 EPITA Research and Development
Laboratory
// (LRDE)
// Copyright (C) 2009, 2010
, 2011
EPITA Research and Development
//
Laboratory
(LRDE)
//
// This file is part of Olena.
//
...
...
@@ -48,11 +48,15 @@ namespace mln
namespace
convert
{
/// Conversion of an unsigned \p from towards a value \p to.
template
<
typename
V
>
void
from_to
(
const
unsigned
&
from
,
Value
<
V
>&
to
);
/// Conversion of an unsigned \p from towards a value \p to.
template
<
typename
V
>
void
from_to
(
const
unsigned
&
from
,
Value
<
V
>&
to
);
/// Conversion of an unsigned \p from towards a bool \p to.
inline
void
from_to_
(
const
unsigned
&
from
,
bool
&
to
);
# ifndef MLN_INCLUDE_ONLY
...
...
@@ -120,6 +124,16 @@ namespace mln
}
// Facades.
// unsigned-> bool
inline
void
from_to_
(
const
unsigned
&
from
,
bool
&
to
)
{
to
=
(
from
!=
0u
);
}
}
// end of namespace mln::convert::over_load
...
...
milena/mln/value/label.hh
View file @
e69979da
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and
Development
// Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010
, 2011
EPITA Research and
//
Development
Laboratory (LRDE)
//
// This file is part of Olena.
//
...
...
@@ -119,6 +119,11 @@ namespace mln
void
from_to_
(
const
value
::
label
<
n
>&
from
,
bool
&
to_
);
// label -> unsigned.
template
<
unsigned
n
>
void
from_to_
(
const
value
::
label
<
n
>&
from
,
unsigned
&
to_
);
}
// end of namespace mln::convert::over_load
}
// end of namespace mln::convert
...
...
@@ -233,6 +238,7 @@ namespace mln
to_
=
from
;
}
// int_u<n> -> bool
template
<
unsigned
n
>
inline
void
...
...
@@ -241,6 +247,16 @@ namespace mln
to_
=
(
from
!=
0u
);
}
// int_u<n> -> unsigned
template
<
unsigned
n
>
inline
void
from_to_
(
const
value
::
label
<
n
>&
from
,
unsigned
&
to_
)
{
to_
=
from
;
}
}
// end of namespace mln::convert::over_load
}
// end of namespace mln::convert
...
...
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