[ICL] Compile error when using "is_numeric"
Hi,
I've just checked-out the last SVN version of ICL and after compiling with
gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)
(flags: -Wall -Wextra -pedantic -ansi)
I get these errors:
--- [error] ---
boost-trunk/boost/icl/concept/interval_bounds.hpp:89:58: error:
type/value mismatch at argument 2 in template parameter list for
‘template<class Type, class Compare, bool Enable> struct
boost::icl::numeric_minimum’
boost-trunk/boost/icl/concept/interval_bounds.hpp:89:58: error:
expected a type, got ‘boost::icl::is_numeric<Type>::value’
...
boost-trunk/boost/icl/concept/interval_bounds.hpp:104:58: error:
type/value mismatch at argument 2 in template parameter list for
‘template<class Type, class Compare, bool Enable> struct
boost::icl::numeric_minimum’
boost-trunk/boost/icl/concept/interval_bounds.hpp:104:58: error:
expected a type, got ‘boost::icl::is_numeric<Type>::value’
...
boost-trunk/boost/icl/left_open_interval.hpp:52:64: error: type/value
mismatch at argument 2 in template parameter list for ‘template<class
Type, class Compare, bool Enable> struct boost::icl::numeric_minimum’
boost-trunk/boost/icl/left_open_interval.hpp:52:64: error: expected
a type, got ‘boost::icl::is_numeric<Type>::value’
...
boost-trunk/boost/icl/open_interval.hpp:51:64: error: type/value
mismatch at argument 2 in template parameter list for ‘template<class
Type, class Compare, bool Enable> struct boost::icl::numeric_minimum’
boost-trunk/boost/icl/open_interval.hpp:51:64: error: expected a
type, got ‘boost::icl::is_numeric<Type>::value’
--- [/error] ---
To solve this problem, it seems it is sufficient to prefix the use of
"is_numeric" with "typename".
Here below is the diff file:
--- [diff] ---
Index: boost/icl/left_open_interval.hpp
===================================================================
--- boost/icl/left_open_interval.hpp (revision 72177)
+++ boost/icl/left_open_interval.hpp (working copy)
@@ -49,7 +49,7 @@
// Only for discrete types this ctor creates an interval containing
// a single element only.
BOOST_STATIC_ASSERT((icl::is_discrete<DomainT>::value));
- BOOST_ASSERT((numeric_minimum<DomainT,
is_numeric<DomainT>::value >::is_less_than(val) ));
+ BOOST_ASSERT((numeric_minimum<DomainT, typename
is_numeric<DomainT>::value >::is_less_than(val) ));
}
/** Interval from <tt>low</tt> to <tt>up</tt> with bounds
<tt>bounds</tt> */
Index: boost/icl/concept/interval_bounds.hpp
===================================================================
--- boost/icl/concept/interval_bounds.hpp (revision 72177)
+++ boost/icl/concept/interval_bounds.hpp (working copy)
@@ -86,7 +86,7 @@
{
if(is_left_closed(decl) && !is_left_closed(repr))
{
- BOOST_ASSERT((numeric_minimum<Type, is_numeric<Type>::value
>::is_less_than(low) ));
+ BOOST_ASSERT((numeric_minimum<Type, typename
is_numeric<Type>::value >::is_less_than(low) ));
return icl::pred(low);
}
else if(!is_left_closed(decl) && is_left_closed(repr))
@@ -101,7 +101,7 @@
{
if(!is_right_closed(decl) && is_right_closed(repr))
{
- BOOST_ASSERT((numeric_minimum<Type, is_numeric<Type>::value
>::is_less_than(up) ));
+ BOOST_ASSERT((numeric_minimum<Type, typename
is_numeric<Type>::value >::is_less_than(up) ));
return icl::pred(up);
}
else if(is_right_closed(decl) && !is_right_closed(repr))
Index: boost/icl/open_interval.hpp
===================================================================
--- boost/icl/open_interval.hpp (revision 72177)
+++ boost/icl/open_interval.hpp (working copy)
@@ -48,7 +48,7 @@
// Only for discrete types this ctor creates an interval containing
// a single element only.
BOOST_STATIC_ASSERT((icl::is_discrete<DomainT>::value));
- BOOST_ASSERT((numeric_minimum<DomainT,
is_numeric<DomainT>::value >::is_less_than(val) ));
+ BOOST_ASSERT((numeric_minimum<DomainT, typename
is_numeric<DomainT>::value >::is_less_than(val) ));
}
/** Interval from <tt>low</tt> to <tt>up</tt> with bounds
<tt>bounds</tt> */
--- [/diff] ---
Can you fix it?
Thank you very much!!
Best,
-- Marco
2011/5/26 sguazt <marco.guazzone@gmail.com>:
Hi,
I've just checked-out the last SVN version of ICL and after compiling with gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) (flags: -Wall -Wextra -pedantic -ansi)
I get these errors: [..]
Sorry, this was an uncareful commit ... should be fixed now. -- Interval Container Library [Boost.Icl] http://www.joachim-faulhaber.de
On Thu, May 26, 2011 at 2:00 PM, Joachim Faulhaber <afojgo@googlemail.com> wrote:
2011/5/26 sguazt <marco.guazzone@gmail.com>:
Hi,
I've just checked-out the last SVN version of ICL and after compiling with gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) (flags: -Wall -Wextra -pedantic -ansi)
I get these errors: [..]
Sorry, this was an uncareful commit ... should be fixed now.
Thank you so much!! Best, -- Marco
On Thu, May 26, 2011 at 2:48 PM, sguazt <marco.guazzone@gmail.com> wrote:
On Thu, May 26, 2011 at 2:00 PM, Joachim Faulhaber <afojgo@googlemail.com> wrote:
2011/5/26 sguazt <marco.guazzone@gmail.com>:
Hi,
I've just checked-out the last SVN version of ICL and after compiling with gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) (flags: -Wall -Wextra -pedantic -ansi)
I get these errors: [..]
Sorry, this was an uncareful commit ... should be fixed now.
Thank you so much!!
Hi Joachim, Here's another ;) --- [diff] --- --- boost/icl/open_interval.hpp (revision 72203) +++ boost/icl/open_interval.hpp (working copy) @@ -24,6 +24,7 @@ public: typedef open_interval<DomainT,Compare> type; typedef DomainT domain_type; + typedef ICL_COMPARE_DOMAIN(Compare,DomainT) domain_compare; public: //========================================================================== --- [/diff] --- That is, you have to add a typedef for "domain_compare". Thank you very much Best, -- Marco
2011/5/27 sguazt <marco.guazzone@gmail.com>:
On Thu, May 26, 2011 at 2:48 PM, sguazt <marco.guazzone@gmail.com> wrote:
On Thu, May 26, 2011 at 2:00 PM, Joachim Faulhaber <afojgo@googlemail.com> wrote:
2011/5/26 sguazt <marco.guazzone@gmail.com>:
Hi,
I've just checked-out the last SVN version of ICL and after compiling with gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4) (flags: -Wall -Wextra -pedantic -ansi)
I get these errors: [..]
Sorry, this was an uncareful commit ... should be fixed now.
Thank you so much!!
Hi Joachim,
Here's another ;)
--- [diff] --- --- boost/icl/open_interval.hpp (revision 72203) +++ boost/icl/open_interval.hpp (working copy) @@ -24,6 +24,7 @@ public: typedef open_interval<DomainT,Compare> type; typedef DomainT domain_type; + typedef ICL_COMPARE_DOMAIN(Compare,DomainT) domain_compare;
public: //========================================================================== --- [/diff] ---
That is, you have to add a typedef for "domain_compare".
Thank you very much
Done :)
participants (2)
-
Joachim Faulhaber -
sguazt