Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Template Question

Reply
Thread Tools

Template Question

 
 
Jorgen Grahn
Guest
Posts: n/a
 
      02-02-2013
On Fri, 2013-02-01, 88888 Dihedral wrote:
> Jorgen Grahn??? 2013???2???1????????????UTC+8??????6???35???37???? ????????
>> On Wed, 2013-01-30, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
>>
>> ...
>>
>> > I do not want someone to teach me C++! I want someone to explain
>> > me the specific use of templates!

>>
>> With all respect, if you don't understand that simple template, you
>> *do* need someone to teach you that part of C++.
>>
>> It does take some practice before it feels natural. One trick: often
>> the template is in practice only used with one or a few different
>> argument types.
>>
>> Think away the template aspect and imagine it says Foo<int> instead of
>> template<class T> Foo<T>. Foo<int> is just a normal type which
>> happens to have funny characters in its name.
>>
>> Then think about Foo<std::string> for a moment. Would that compile? If
>> not, why? That gives you some perspective.
>>
>> Another trick if you can call it that, is to ignore the template
>> meta-programming area for now. You don't need to understand that to
>> make good use of templates.


> Well, even the complex numbers are not provided
> in the C++ language standard.
>
> Anyway a lot programmers just wrote or got thier
> own extensions in jobs.


I fail to see the connection between my posting and your response.
Is there one?

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
 
88888 Dihedral
Guest
Posts: n/a
 
      02-02-2013
(E-Mail Removed)於 2013年2月2日星期*UTC+8下午5時40分32秒 道:
> On Sat, 2 Feb 2013 00:39:40 -0800 (PST), 88888 Dihedral
>
> <(E-Mail Removed)> wrote:
>
>
>
> >David Harmon? 2013?2?2????UTC+8??2?44?17????

>
> >> On Fri, 1 Feb 2013 09:28:15 -0800 (PST) in comp.lang.c++, 88888

>
> >>

>
> >> Dihedral <(E-Mail Removed)> wrote,

>
> >>

>
> >> >Well, even the complex numbers are not provided

>
> >>

>
> >> >in the C++ language standard.

>
> >>

>
> >>

>
> >>

>
> >> Yes, they are.

>
> >>

>
> >> #include <complex>

>
> >

>
> >I am vage about this. Complex is not a built-in type

>
> >but a template type in C++.

>
>
>
>
>
> But it is defined by the C++ standard.


I'll express my oppinions about the built-in types
in a strong typed language.

When vars of int, float, double, maybe qdouble or
whatever were mixed in an expression, the type lifting rule of the result is clearly defined.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
r H2 deduce deduce template argument of a template class inheritingfrom a non template base? nguillot C++ 5 03-08-2009 05:56 PM
How to use the template member function of a template in the memberfunction of another template class? Peng Yu C++ 3 10-26-2008 03:51 PM
template template arguments: expected a class template, got `Component<T1, T2, T3> gary.bernstein@gmail.com C++ 1 06-08-2007 07:10 AM
Re: A Newbie Question about template template template tom_usenet C++ 0 07-24-2003 12:06 PM
Re: A Newbie Question about template template template Chris Theis C++ 2 07-24-2003 09:42 AM



Advertisments