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 8388841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:33:34+00:00 2026-06-09T18:33:34+00:00

Why do I keep on getting the following error in this code in Visual

  • 0

Why do I keep on getting the following error in this code in Visual C++ 2010, and how do I fix it while maintaining the type inference capability for the member variable?

error C2825: 'Foo<T>::value_type': must be a class or namespace when followed by '::'

template<class T>
struct Foo
{
    typedef typename T::value_type value_type;

    template<class M>
    void foo(M value_type::*member) const;   // error
};
struct S { typedef int value_type; };

int main() { Foo<S> s; }
  • 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-09T18:33:35+00:00Added an answer on June 9, 2026 at 6:33 pm

    The template parameter T turns out to be type S, therefore value_type turns out to be int (the nested-type in S). So how can you write value_type::*member? Note that it turns out to be int::*member which doesn’t make sense. int is not a class type.

    I think you meant T::*member instead of value_type::*member.

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

Sidebar

Related Questions

Not sure what is wrong with this code. I keep getting the following error:
I keep getting following error on this code: #Setup default variables $webUrl = Get-SPWeb
I'm trying to get http://www.gelens.org/code/gevent-websocket/ running and keep getting the following error. socket_id=1 already
I'm using Visual Studio 2008 Express edition, and keep getting the following error: Cascadedisplay.h(4)
I keep getting an error with the following bit of code. It is probably
With the following code, I keep getting error C2535 when I compile. It's complaining
I keep getting the following error message when I run my code in debug.
I'm trying to execute this code nmea2kml.cpp but I keep getting the following errors.
I'm running some code through JSHint and I keep getting the following error: Don't
I keep getting the following error: Method not found: 'Void Castle.MicroKernel.ComponentActivator.ComponentActivatorException..ctor this is 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.