473,385 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ICE with template function pointer

VS.NET 2003 V7.1.3088 - Unmanaged code

I'm getting:

c:\Proj\pt.h(581) : 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>::circfcn)( 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 1305
>VS.NET 2003 V7.1.3088 - Unmanaged code

I'm getting:

c:\Proj\pt.h(581) : 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>::circfcn)( 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
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...
5
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:...
4
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...
4
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++)...
13
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
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...
5
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...
3
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...
6
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.