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

Template Partial Specialization

Hello everyone,
About Template Partial Specialization,

http://www.cprogramming.com/tutorial...alization.html

sometimes in real case like below,

http://www.sgi.com/tech/stl/iterator_traits.html

there will be two definitions at the same time,

Expand|Select|Wrap|Line Numbers
  1. template <typename T>
  2. class Foo {
  3. }
  4.  
  5. template <typename T>
  6. class Foo <T *>
  7. {
  8. }
  9.  
In theory, compiler will match the latter one with first priority
compared with the 1st one.

My question is, I tihnk for basic data types it is easy to match,

example,

when we pass Foo <int*>, the latter one is matched and T is int. But
for arbitrary data types, like used data types, how could compiler
judge whether a type is pointer (when the latter template class should
be matched) or not a pointer (when the first template class should be
matched).
thanks in advance,
George
Nov 19 '07 #1
4 1389
George2 wrote:
Hello everyone,
About Template Partial Specialization,
And this has precisely what relationship to the C language?

This is your third message on comp.lang.c today, as far as I can see,
which discusses something totally irrelevant to comp.lang.c

You've been pointed to a more appropriate newsgroup.

If you only post and don't read, there's little point you bothering.

Welcome to my killfile.
Nov 19 '07 #2
In article <fh**********@aioe.org>, Mark Bluemel
<ma**********@pobox.comwrote on Monday 19 Nov 2007 9:36 pm:
George2 wrote:
>Hello everyone,
About Template Partial Specialization,

And this has precisely what relationship to the C language?

This is your third message on comp.lang.c today, as far as I can see,
which discusses something totally irrelevant to comp.lang.c
And in all, this is the sixth C++ question that the OP has posted to
comp.lang.c.
You've been pointed to a more appropriate newsgroup.

If you only post and don't read, there's little point you bothering.

Welcome to my killfile.
He's looking more and more like a troll.

Nov 19 '07 #3
santosh wrote:
(about George2)
He's looking more and more like a troll.
In which case my killfile is an ideal place for him.
Nov 19 '07 #4
On Mon, 19 Nov 2007 07:59:22 -0800 (PST), George2
<ge*************@yahoo.comwrote in comp.lang.c:
Hello everyone,
Are you a troll, or just thick?

As has been pointed out, this is the sixth question about the C++
language you have asked on comp.lang.c since November 11.

Five times before you have been told your question belongs in
comp.lang.c++.

So either you are trolling, or just plain too stupid to read. Don't
bother replying as to which it is, I won't see it. Like others here,
I have given you a well-earned place in my killfile.

*plonk*
About Template Partial Specialization,
No, about your trolling or stupidity.

[posted and mailed]

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Nov 19 '07 #5

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

Similar topics

17
by: Paul MG | last post by:
Hi Template partial specialization always seems like a fairly straightforward concept - until I try to do it :). I am trying to implement the input sequence type (from Stroustrup section...
8
by: Agent Mulder | last post by:
Hi group, I have a problem with partial template specialization. In the code below I have a template struct Music with one method, play(), and three kinds of music, Jazz, Funk and Bach. When I...
4
by: TT \(Tom Tempelaere\) | last post by:
Comeau compiler complains (too few arguments for class template "B") at line *** #include <memory> template<typename T, size_t n> struct A {}; template<typename T, size_t n> struct B;
1
by: BekTek | last post by:
I'm still confused about the template partial specialization which is used in many libraries.. due to lack of introduction for beginner.. Could you tell me about that in short? Thanks in...
5
by: Levent | last post by:
Hi, Why doesn't this work? (tried with gcc 3.3.3 and VC++ 7.1): #include <iostream> template<class T, unsigned N> struct Foo { void func(); }; template<class T, unsigned N>
4
by: Alfonso Morra | last post by:
Does VC 7.1 support template specialization and partial specialization ?
9
by: Marek Vondrak | last post by:
Hello. I have written the following program and am curious why it prints "1" "2". What are the exact effects of explicitly providing function template parameters at the call? Is the second...
9
by: stephen.diverdi | last post by:
Can anyone lend a hand on getting this particular template specialization working? I've been trying to compile with g++ 4.1 and VS 2005. ...
8
by: flopbucket | last post by:
Hi, I want to provide a specialization of a class for any type T that is a std::map. template<typename T> class Foo { // ... };
1
by: Ioannis Gyftos | last post by:
Hello, First the code :) /////////////////////////////////////////////////////////////////////////////////// // in another header file namespace LJC{
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
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,...

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.