|
Boost Users : |
From: chun ping wang (cablepuff_at_[hidden])
Date: 2007-10-12 19:33:52
namespace boost
{
template <class T, class U>
char (& is_op_test(boost::operators<T,U> const&) )[2];
template <class T>
char is_op_test(T const&);
template<class T>
T const& make();
template <class T>
struct is_operators
: boost::mpl::bool_<(sizeof(is_op_test(make<T>())) == 2)>
{};
}
and this function declaration.
template <typename T,
template <typename ELEM, typename = std::allocator<ELEM> >
class CONT
>
typename boost::enable_if<boost::mpl::or_<boost::is_integral<T>, boost::
is_operators<T> >, CONT<T> >::type
primelist(const T& MAX_BOUND, const T& K, boost::function<bool(const T&,
const T&)> f);
BigInteger class declaration looks like this..
class BigInteger : public BigUnsigned, boost::operators<BigInteger>,
boost::operators<BigInteger, int>
{
};
I compile with T = int and it works.
When i compile with T = BigInteger I get the following errors.
on visual c++.
error C2770: invalid explicit template argument(s) for
'boost::enable_if<boost::mpl::or_<boost::is_integral<T>,boost::is_operators<T>
>,CONT<T>>::type primelist(const T &,const T &,boost::function<bool(const T
&,const T &)>)'
./cs512/c++/primeMain.cpp(24) : see declaration of 'primelist'"
on mingw dev-cpp i get this error.
unable to find function....
In both cases passing BigInteger does not work.
thanks for the help.
BigInteger does derive from boost::operators and theirs two overload.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net