Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #6260 > unrolled thread

template

Started bybx <bxcvs@yahoo.com>
First post2011-06-05 23:47 -0700
Last post2011-06-06 18:21 +0200
Articles 6 — 4 participants

Back to article view | Back to comp.lang.c++


Contents

  template bx <bxcvs@yahoo.com> - 2011-06-05 23:47 -0700
    Re: template ruben safir <ruben@mrbrklyn.com> - 2011-06-06 08:22 +0000
      Re: template bx <bxcvs@yahoo.com> - 2011-06-06 03:02 -0700
        Re: template ruben safir <ruben@mrbrklyn.com> - 2011-06-06 06:05 -0400
    Re: template "Bo Persson" <bop@gmb.dk> - 2011-06-06 12:17 +0200
      Re: template Michael <Michael@notspam.com> - 2011-06-06 18:21 +0200

#6260 — template

Frombx <bxcvs@yahoo.com>
Date2011-06-05 23:47 -0700
Subjecttemplate
Message-ID<4a753538-47af-4366-a15e-6fb41f70173f@d28g2000yqf.googlegroups.com>
template<>
typename basic_trait<std::vector<float> >::Basic
DataRef<std::vector<float> >::operator[](std::size_t index) const;

Hi
with the above i get error:
using ‘typename’ outside of template
Any help? Also I don't understand typename.
Thanks

[toc] | [next] | [standalone]


#6265

Fromruben safir <ruben@mrbrklyn.com>
Date2011-06-06 08:22 +0000
Message-ID<isi2nm$flj$2@reader1.panix.com>
In reply to#6260
On Sun, 05 Jun 2011 23:47:34 -0700, bx wrote:

> template<>
> typename basic_trait<std::vector<float> >::Basic
> DataRef<std::vector<float> >::operator[](std::size_t index) const;
> 
> Hi
> with the above i get error:
> using ‘typename’ outside of template Any help? Also I don't understand
> typename. Thanks

This is a VERY basic template question.  Where did you lift this from.  it looks like a specialization
of an existing genralized template...and yes typename (or class) has to be within the angle brackets.

Ruben

[toc] | [prev] | [next] | [standalone]


#6273

Frombx <bxcvs@yahoo.com>
Date2011-06-06 03:02 -0700
Message-ID<f66d79e0-f0ea-4606-bc22-504f6e3212c3@m4g2000yqk.googlegroups.com>
In reply to#6265
sure most basic but what does that look like? I only get errors
whatever i try...

[toc] | [prev] | [next] | [standalone]


#6274

Fromruben safir <ruben@mrbrklyn.com>
Date2011-06-06 06:05 -0400
Message-ID<isi8ov$i56$1@reader1.panix.com>
In reply to#6273
On 06/06/2011 06:02 AM, bx wrote:
> sure most basic but what does that look like? I only get errors
> whatever i try...


Did you try reading about them before you did whatever your trying to 
do.  The question is so fundamental that one can't begin to answer it 
without writing a text book.

[toc] | [prev] | [next] | [standalone]


#6276

From"Bo Persson" <bop@gmb.dk>
Date2011-06-06 12:17 +0200
Message-ID<953nppFhccU1@mid.individual.net>
In reply to#6260
bx wrote:
> template<>
> typename basic_trait<std::vector<float> >::Basic
> DataRef<std::vector<float> >::operator[](std::size_t index) const;
>
> Hi
> with the above i get error:
> using ‘typename’ outside of template
> Any help? Also I don't understand typename.
> Thanks

typename is currently only allowed when actually needed. As there are 
no template parameters in "basic_trait<std::vector<float> >::Basic", 
this is just an ordinary type, and typename is not needed.


In the upcoming C++11 these rules are somewhat relaxed.


Bo Persson
 

[toc] | [prev] | [next] | [standalone]


#6298

FromMichael <Michael@notspam.com>
Date2011-06-06 18:21 +0200
Message-ID<f3ad1$4decfe7b$c299b6a7$8916@news.hispeed.ch>
In reply to#6276
Thanks...now much more to learn...

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web