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

  • Home
  • SEARCH
  • 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 6698347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:34:02+00:00 2026-05-26T06:34:02+00:00

I’ve been tasked with getting some old code working. It’s dated from 2006 and

  • 0

I’ve been tasked with getting some old code working. It’s dated from 2006 and I believe it was written in visual studio. I get this error when compiling with g++ 4.5.2 using ming32 on a windows machine and I get the same error compiling with g++ 4.1.2 on a unix machine(not sure what flavor)

“_Dist_type was not declared in this scope”

#include <algorithm>
#include <vector>

template<class ReturnType, class RandomIterator, class _Ty> inline
ReturnType interpolate(RandomIterator _F, RandomIterator _L, const _Ty& _V, RandomIterator _F2)
{
  return _Dist_type(_F);
}

class Interpolator
{
public:
  double interp(const std::vector<double>& xValues, const std::vector<double>& yValues, 
    const double x0) const
  {
    //1-D interpolation
    return interpolate<double>(xValues.begin(), xValues.end(), x0, yValues.begin());
  }
};

I’ve tried googling for _dist_Type, but there doesn’t seem to be a lot of information out there. I did find one source, but I’m not sure how much it can help. http://en.allexperts.com/q/C-1040/STL-Iterator.htm

It’s my understanding that _Dist_type is part of a very old version of the STL library which neither build machine has. How could I solve this? I’m not even sure what the function does.

Any help is greatly appreciated.

  • 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-05-26T06:34:03+00:00Added an answer on May 26, 2026 at 6:34 am

    _Dist_type is an internal implementation detail used by Visual Studio’s standard library. Names starting with an underscore followed by an uppercase letter are reserved by the implementation and must never be called directly from user code.

    You’ll have to figure out what that function does and duplicate the functionality in a portable manner. If you’re lucky you might find that there is a function in the standard library that already implements this functionality and you can just replace the call.

    EDIT:
    Both Visual Studio 2005 & 2010 have _Dist_type defined as

    template<class _Iter> inline
    typename iterator_traits<_Iter>::difference_type
    *_Dist_type(_Iter)
    {   // return distance type from arbitrary argument
      return (0);
    }
    

    So it is just returning a value of 0 of type std::iterator_traits<RandomIterator>::difference_type

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I have a text area in my form which accepts all possible characters from

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.