🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Template parameters

#1777
From: James Mansion LADS LDN X4923
Date: Thu, 17 Aug 1995 13:30
29 lines
930 bytes
Given:

template <size_t N> class Foo { public: Foo() ; /*...*/ }

And:

enum { a = 1024 } ;
#define b 1024
#define c size_t(1024)

No prises for guessing that:

Foo<c> f1 ;

is OK.

But what about these?

Foo<a> f2 ;
Foo<b> f3 ;

James

(Only 'c' works with my Sun compiler.  It seems unwilling to perform even the
basic int conversions)
---
[ 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: <9508171015.AA10473@fatserv.lonnds.ml.com>
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: 17 Aug 95 13:30:18 GMT
Approved: fjh@cs.mu.oz.au
Return-Path: <daemon@ncar.UCAR.EDU>
X-Original-Date: Thu, 17 Aug 95 11:15:55 BST
From: mansionj@lonnds.ml.com (James Mansion LADS LDN X4923)
Message-ID: <9508171015.AA10473@fatserv.lonnds.ml.com>
Subject: Template parameters
Newsgroups: comp.std.c++