Near Matches
Ignore Exact
Everything
2
examples of computations with typelists
(
idea
)
by
ariels
Sun May 13 2001 at 8:35:07
int32
shows how ugly a (nearly)
standard
implementation of a 32-bit int type can be in
ISO C
. It's possible to define a
template
d
typedef
to select ints with a desired number of
bit
s: see
Int<bits>
.
fibonaci
defines a nice
C++ multitype
using a
typelist
.
It's
interesting
to note that
typedef
is often
essential
to be able to phrase these constructions! In
C
,
typedef
"just" defines an
alias
for the type, but could theoretically have been removed from the language. But in
C++
typedef
lets you do things that would be impossible had it not been in the language. The examples use
typedef
to "hoist"
type
s out of a typelist at
compile-time
; I know of no other means to do so.
Int<bits>
int32
C++ multitype
template meta-programming
typelist
Template
C++ typedef
Levaquin
The Weakest Link
typedef
Log in
or
register
to write something here or to contact authors.