🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #17055

Re: template newbie question

#17055
From: Brian Dumas
Date: Fri, 11 Apr 2003 14:59
35 lines
1918 bytes
thanks, I'll try it.


"Pete Fraser" <pete.fraser@at.frasersoft.dot.net> wrote in message
news:3e96d5b5@newsgroups.borland.com...
> You can use the automatic conversions for AnsiString.
> as in:
> AnsiString Str = 1;
> AnsiString Str = 1.1;
> HTH Pete
>
> "Brian Dumas" <brian@kvdco.com> wrote in message news:3e96d1d8
> $1@newsgroups.borland.com...
> I have a template defined similar to this
>
> template <typename K, typename T>
> class myclass
> {
> ...
> }
>
> Now, when values of type K are sent in, I want to convert the value of K
to
> a string. But, I need to know the type. If K is a string, then I don't
need
> to change anything. If K is an integer, the I'll use IntToStr, if K is a
> double I can use FormatFloat. But how do I determine K's type. I tried
using
> typeid in a series of if/else statements, but it won't compile. Any
> ideas????
>
> thanks, Brian
>
>
>
Technical Details
Message-ID: <3e96d869$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e96d1d8$1@newsgroups.borland.com> <3e96d5b5@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,47b5e0a09d9eff11
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-04-11 08:05:19 PST
Reply-To: "Brian Dumas" <brian@kvdco.com>
From: "Brian Dumas" <brian@kvdco.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3e96d1d8$1@newsgroups.borland.com> <3e96d5b5@newsgroups.borland.com>
Subject: Re: template newbie question
Date: Fri, 11 Apr 2003 08:59:56 -0600
Lines: 37
Organization: KVD
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 68.64.20.130
Message-ID: <3e96d869$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1050073193 68.64.20.130 (11 Apr 2003 07:59:53 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail