🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2113

Determining between classes and built-in types

#2113
From: Brett W. Denner
Date: Thu, 05 Oct 1995 08:18
20 lines
1132 bytes
Is there a way to identify whether a data type in a template function is a
class or a built-in type?  For example,

template <class T> void
func(T var)
{
    if ( /* test whether T is a built-in type */ )
 	/* do something based on T being a built-in type */;
    else
        /* do something else based on T being a user-define type */;A
}

Will rtti allow me to test for this?  Is there another way of determing this?

Thanks,
Brett
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <Pine.SGI.3.91.951003143924.20596A-100000@gusak>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
Date: 05 Oct 95 08:18:34 GMT
Approved: fjh@cs.mu.oz.au
Organization: -
Newsgroups: comp.std.c++
X-Original-Date: Tue, 3 Oct 1995 14:48:31 -0500 (CDT)
From: "Brett W. Denner" <dennerbw@cliffy.lfwc.lockheed.com>
X-Sender: dennerbw@gusak
Subject: Determining between classes and built-in types
Message-ID: <Pine.SGI.3.91.951003143924.20596A-100000@gusak>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII