🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.objects
Article #16137

Re: Typ należący do parametru template'a (czyli STL w parametrze)

#16137
From: Muchomor
Date: Mon, 09 Apr 2007 15:12
21 lines
1752 bytes
<lrem@lrem.maxnet> wrote in message news:slrnf1kjcu.ave.lrem@lrem.maxnet...
> Witam po raz pierwszy grupę.
>
> Tak z głupia frant postanowiłem opanować pisanie tempalate'ów w c++.
> Popełniłem coś takiego:
> #v+
> template <class T>
> void dump (const T &c)
> {
>        for(T::iterator it = c.begin(); it!=c.end(); it++)
>                cerr << *it << ' ';
>        cerr << '\n';
> }

Poczytaj co to jest typename i kiedy sie go stosuje. A jak go dodasz i dalej 
Ci sie nie bedzie kompilowac to poczytaj czy mozliwe jest deklarowanie 
iterator'a na stalej referencji do kontenera (hint: const_iterator).

pzdr
Muchomor 
Technical Details
Message-ID: <3106b$461a57db$594faf50$19341@news.chello.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!newsfeed01.chello.at!newsfeed02.chello.at!news.chello.pl.POSTED!not-for-mail
References: <slrnf1kjcu.ave.lrem@lrem.maxnet>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!newsfeed01.chello.at!newsfeed02.chello.at!news.chello.pl.POSTED!not-for-mail
Reply-To: "Muchomor" <muchomor_w_kropkiCUT_THIS@gazeta.pl>
From: "Muchomor" <muchomor_w_kropkiCUT_THIS@gazeta.pl>
Newsgroups: pl.comp.objects
References: <slrnf1kjcu.ave.lrem@lrem.maxnet>
Subject: Re: Typ należący do parametru template'a
 (czyli STL w parametrze)
Date: Mon, 9 Apr 2007 17:12:25 +0200
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
Message-ID: <3106b$461a57db$594faf50$19341@news.chello.pl>
X-Complaints-To: abuse@chello.pl
Organization: chello.pl
Lines: 23
NNTP-Posting-Host: 89.79.175.80 (89.79.175.80)
NNTP-Posting-Date: Mon, 09 Apr 2007 17:12:27 +0200
X-Trace: 3106b461a57dbfcea0af519341
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit