Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9085321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:13:00+00:00 2026-06-16T21:13:00+00:00

i get this error in Visual studio 2008: Error 1 error C2664: ‘BaseUtil::Type::CDouble::CDouble(const BaseUtil::Type::CDouble

  • 0

i get this error in Visual studio 2008:
Error 1 error C2664: ‘BaseUtil::Type::CDouble::CDouble(const BaseUtil::Type::CDouble &)’ : cannot convert parameter 1 from ‘boost::icl::no_type’ to ‘const BaseUtil::Type::CDouble &’

Here my class interface:

class CDouble
{
public: 
  CDouble();
  CDouble(const CDouble& _obj);
  CDouble(const double& _val);

  bool operator==(const CDouble& _obj) const;
  bool operator==(const double& _obj) const; 
  bool operator!=(const CDouble& _obj) const;
  bool operator<=(const CDouble& _obj) const;
  bool operator>=(const CDouble& _obj) const;
  bool operator< (const CDouble& _obj) const;
  bool operator> (const CDouble& _obj) const;

  CDouble& operator= (const CDouble& _obj);
  CDouble& operator+=(const CDouble& _obj);
  CDouble& operator-=(const CDouble& _obj);

  const CDouble operator+(const CDouble& _obj) const;
  const CDouble operator-(const CDouble& _obj) const;

  const double operator/(const CDouble& _obj) const;

  CDouble& operator= (double _value);
  CDouble& operator+=(double _value);
  CDouble& operator-=(double _value);
  CDouble& operator*=(double _value);
  CDouble& operator/=(double _value);

  const CDouble operator+(double _value) const;
  const CDouble operator-(double _value) const;
  const CDouble operator*(double _value) const;
  const CDouble operator/(double _value) const;

  operator double() const {return m_value;} 

private:
  CDouble& operator*=(const CDouble&  _obj);
  const CDouble operator*(const CDouble&  _obj) const;
  CDouble& operator/=(const CDouble&  _obj);

  double m_value;
};

The code that trigger the compile error:

  template <class BoundType>
  class Interval
  {
  public:
    BoundType Length() const
    {
      return boost::icl::length(
        boost::icl::construct<boost::icl::interval<BoundType>::type>(m_LowerBound,    m_UpperBound, m_IntervalType())
       );
    }

  private:
    BoundType m_LowerBound, m_UpperBound; 
    typedef boost::icl::interval_bounds (*IntervalType)(); 
    IntervalType m_IntervalType;
  }

  int main()
  {
    Interval<CDouble> typeDouble(-1.0, 1.0);
    typeDouble.Length(); //<-- COMPILE ERROR
  }

I don’t understand the error and don’t know how to solve it.

It work wells with basic type(int, double, ..)

Anyone can help ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:13:02+00:00Added an answer on June 16, 2026 at 9:13 pm

    Here’s the length fonction from boost 1.52 header files:

    template<class Type>
    inline typename boost::enable_if<is_continuous_interval<Type>, 
      typename difference_type_of<interval_traits<Type> >::type>::type
    length(const Type& object)
    {
        typedef typename difference_type_of<interval_traits<Type> >::type DiffT;
        return icl::is_empty(object) ? identity_element<DiffT>::value()
                                     : upper(object) - lower(object);
    }
    

    Found in the file: boost\icl\type_traits\difference_type_of.hpp

    template <class Type>
    struct get_difference_type<Type, false, false>
    {
        typedef no_type type;
    };
    

    So I’m assuming that the boost header files defaut implementation for a type that support difference numerical operator is no_type.

    What must be done, is to provide, at compile time, a definition of a difference type that match one of your contructor. Ie, the contructor copy for instance is your case.

    Although, your type seems like a wapper on a numeric value, maybe boost header files doesn’t get it. Please test this snippet in one of your header files, out of proprietary namespaces.

    #include <boost_1_52_0\boost\icl\type_traits\is_numeric.hpp>
    
    namespace boost{ namespace icl
    {
        template <> 
        struct is_numeric<CDouble>
        {
            typedef is_numeric type;
            BOOST_STATIC_CONSTANT(bool, value = true );
        };
    } }
    

    If it doesn’t works as is, the trick is to tell to boost that your type has a diffence type (a CDouble) so that copy constructor does works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I get rid of this error, I am using Visual Studio 2008
I compile in Visual studio 2008 and get this error. I have researched linkage
sooo if i install first visual studio 2008 i get a error, this is
Hi upon compiling this code in Visual studio 2008 i get the following error
After installing Debugger Canvas and restarting Visual Studio, I get this error for each
I am using Visual Studio 2008 and I get the following error message when
i get this error Cannot open database DataLayer.Context.MedicallexiconContext requested by the login. The login
I get this error repeatedly when developing ASP.Net applications: Cannot create/shadow copy 'XXXXX' when
The following method (in a Visual Studio 2008 ref class) contains a simple error
I get the error: C2275 RHandle: illegal use of this type as an expression

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.