473,395 Members | 2,437 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,395 software developers and data experts.

Unrecognizable template declaration/definition

Hi folks!

Is there anybody that can tell me what´s wrong with this template. I´ve migrate from VC++ 6 to VS 2010.

template<int _Idx,
class _Ty1,
class _Ty2>
typename _Pair_data<_Idx, _STD pair<_Ty1, _Ty2> >::_CType
get(const _STD pair<_Ty1, _Ty2>& _Pr)
{ // return element at _Idx in pair _Pr
return (_Pair_data<_Idx, _STD pair<_Ty1, _Ty2> >::_Val(_Pr));
}
} // namespace tr1
Feb 6 '12 #1
1 6207
weaknessforcats
9,208 Expert Mod 8TB
You have a function template. The typename must be inside the function plus C++ does not support default-int so add a void return type.
Feb 6 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: jack | last post by:
Hi there, I have a short question about template function definition. 1) The following files will not compile in M$ VC++ but will have no problem with g++. 2) However, if I uncomment all...
6
by: blueblueblue2005 | last post by:
Hi, below is the code I copy from c++ tutorial, it is about template specialization, but when I compile, I got error message: error: template-id `module<>' for `int mypair<int>::module()' does...
2
by: Alex Buell | last post by:
This is what I'm trying to compile with GCC 3.4.4 under Linux. The error I'm getting is: g++ -s -O3 -Wall class2.cc -o class2 class2.cc:25: error: template-id `uppercase<>' for `char...
7
by: Kristian Virkus | last post by:
Hello! I would like to write a C programm with multiple include files, where one may use another one (to print the value of a variable). When I try to compile the program below, the linker...
2
by: Joseph Turian | last post by:
I have a class Feature defined, which is a kind of Vocab: template <class T, unsigned I> class Vocab : boost::totally_ordered<Vocab<T,I { public: Vocab(); Vocab(const T& t); template<typename...
2
by: Alan | last post by:
Does a template class declaration, like template <class T> have to come immediately prior to the declaration of the function, e.g., T do_something (T something) { . . . } that uses it?
5
by: aryan | last post by:
Is it not allowed to have template function definition in a .cc file? Here is the scenario. The tempage function declaration is in a header file and the definition in a .cc file. The function is...
5
by: ruebezaehler | last post by:
Hello, I should separate the definition and declaration of template code. This works fine for non-specialized templates. But I do not know how to do this for specialized templates. Example: ...
2
by: Hel | last post by:
Hi, I'm sure you are familiar with this problem: A.h: template <unsigned Nstruct A { static const unsigned a; };
10
by: Jeffrey | last post by:
My understanding is that if you write class X { int y; static int z; }; then you've defined (and declared) X and y, but you have only declared (and not defined) z. If you'd like to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
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...
0
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...

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.