473,799 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ICE with template function pointer

VS.NET 2003 V7.1.3088 - Unmanaged code

I'm getting:

c:\Proj\pt.h(58 1) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information

Pseudo code:

template <class T> class Vec2
{
protected:
T n[2];
public:
Vec2() { n[0] = n[1] = 0; }
};

template <class T> class Pt2 : public Vec2<T>
{
public:
Pt2() {}

static void (*circfcn)( T x, T y, T rad);
};

// Chokes here:
template <class T> void (*Pt2<T>::circf cn)( T x, T y, T rad);

Any fix/workaround?

Thanks,
Drew
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 2/12/2004
Nov 17 '05 #1
2 1321
>VS.NET 2003 V7.1.3088 - Unmanaged code

I'm getting:

c:\Proj\pt.h(5 81) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information

Pseudo code:

template <class T> class Vec2
{
protected:
T n[2];
public:
Vec2() { n[0] = n[1] = 0; }
};

template <class T> class Pt2 : public Vec2<T>
{
public:
Pt2() {}

static void (*circfcn)( T x, T y, T rad);
};

// Chokes here:
template <class T> void (*Pt2<T>::circf cn)( T x, T y, T rad);


Drew,

Pasting your code snippet into a VS2003 C++ console framework doesn't
give the ICE for me. Do you have a short console example that you can
reproduce the problem with?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2
>Just getting back to this. Here's a .zip with a small project.
It's actually a static lib project, I don't know if that matters.


Drew.

That does reproduce the problem with the VS2003 compiler. The good
news is that it compiles fine with the Whidbey alpha release compiler,
so presumably it's something that MS are aware of and have already
fixed.

If you can't see a work-around for this problem with VS2003, I suggest
that you report the issue with MS PSS (phone). I don't think you
shouldn't be charged - since it's a bug, and they may be able to come
up with a work-around.

Dave
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
4591
by: Surya Kiran | last post by:
Hi all, I've written a function template. say template <class T> fn (T var) { ... } Is there any way, from within the function, can we check what type of argument we've passed on to the function (double, float etc) ?? Thanks in advance,
5
2964
by: Suzanne Vogel | last post by:
Is it possible to store a pointer to a template function? eg, template<class T> fooFunc() {...} fptr = fooFunc; // <-- I couldn't find any info here, not even in the forums: http://www.function-pointer.org/
4
2143
by: Carsten Spieß | last post by:
Hello all, i have a problem with a template constructor I reduced my code to the following (compiled with gcc 2.7.2) to show my problem: // a base class class Base{}; // two derived classes
4
2253
by: firegun9 | last post by:
Hello everyone, here is my program: /////////////////////////////// #include <iostream> using namespace std; void multi(double* arrayPtr, int len){ for(int i=0; i<len; i++) *(arrayPtr+i)*=2;
13
1746
by: Gurikar | last post by:
Hello, Can anyone tell me whats wrong in this? // template function template<class T> inline void test(T* ptr) { cout<<"Pointer is"<<ptr<<endl; ptr = NULL; cout<<"Pointer is"<<ptr<<endl;
4
4261
by: Vijai Kalyan | last post by:
I was decomposing a task into different policies. Essentially, there is a general option obtained from a server and user options obtained from configuration variables. The two options are complementary to one another. So I proceeded to decompose the tasks that deal with user options into two functions. Each of the functions do something and towards the end they do supplementary tasks that depend on the server option. The whole things...
5
2271
by: StephQ | last post by:
This is from a thread that I posted on another forum some days ago. I didn't get any response, so I'm proposing it in this ng in hope of better luck :) The standard explanation is that pointer to functions are hard to inline for the compiler, and so you won't be able to avoid function call overhead. This is an important aspect when you are calling a function very frequently for evaluation reason: think of the problem of performing...
3
2457
by: .rhavin grobert | last post by:
guess you have the following: _________________________________________________ template <class T> class CQVector { public: // find an element, returns index or -1 if none is found int find(int id) const; private:
6
391
by: Gaijinco | last post by:
I'm trying to do a template class Node. My node.hpp is: #ifndef _NODE_HPP_ #define _NODE_HPP_ namespace com { namespace mnya { namespace carlos { template <typename T>
2
6649
by: Clyde | last post by:
Hi, what i'm trying to do is: /////////////// Code Start template <class TType, int* p = 0> class Template { public:
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10252
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.