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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:37:37+00:00 2026-06-11T14:37:37+00:00

The following code has no problems in gcc. in VS 2010 express it fails

  • 0

The following code has no problems in gcc. in VS 2010 express it fails giving

------ Build started: Project: helium, Configuration: Debug Win32 ------
  testvs.cpp
..\..\helium\src\legacy\testvs.cpp(21): error C2664: 'ulink' : cannot convert parameter 1 from 'VP<T>' to 'VP<T> &'
          with
          [
              T=F
          ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

In it the same for any visual studio version or is it a problem limited to vs 2010?
The problem disappears if the second operator() definition is removed

template<typename T> struct S{
    void operator()(T&){}
    void operator()(){}
};



  template <typename T,typename G=typename T::GP,void (S<T>::*f)(T&) =&S<T>::operator() > struct VP{
 void fa(){}
 };


template<typename T> void ulink( VP<T >& v){}



  struct F{
    typedef int GP;
  };

   void f(){

     VP<F> vps;
     ulink(vps);
   }
  • 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-11T14:37:38+00:00Added an answer on June 11, 2026 at 2:37 pm

    Thanks to Seth Carnegie for confirming that this is yet another VS unsolved bug.

    Possible workarounds

    1) include in another structure

    template<typename L> struct Con{
         L& l;
         Con(L& pl):l(pl){}
    };
    
    template<typename T> void ulink(const Con<VP<T > >& v){
    v.l.fa();
    }
    

    2) keep the template more generic

    template<typename T> void gulink(T& v){
    v.fa();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code, which has the following two problems: Traceback (most recent
I'm new to jquery and has some problems with the following code, the code
I'm trying to build, using msvs 2010 the project found at the following git:
I keep getting complaint from the g++ compiler that the following code has problems.
A recent build of GCC 4.8 gives the following code, when in a header
The following code has concurrency issues. Here inDegVec is a global int * ,
So I'm trying to play a video and the following code has worked for
I am generating a simple form with php. The following code has been reduced
I have the following code that has @item.ID from razor: <a href=# id=deleteitem(@item.ID)>Delete</a> When
I have tried the following code but has no effect: Imports system.Runtime.InteropServices <DllImport(UxTheme.DLL, BestFitMapping:=False,

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.