🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by James Mansion LADS LDN X4923 Thu, 17 Aug 1995 13:30
Template parameters
#1777
Author: 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. ]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads