Re: Java equivalent of C++ Spirit or Boost Graph Library ?
- From: "Chris Uppal" <chris.uppal@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 29 Oct 2006 10:04:07 -0000
Christopher Benson-Manica wrote:
[me:]
In particular, Java does not have templates, nor anything which even
vaguely resembles them.
Surely the 1.5 generics can be said to at least "vaguely resemble" C++
templates?
Not really, at least not as I see it. The two language features are completely
different (apart from superficial syntax); the "similarity" is only that there
is an overlap in what they are used /for/.
C++ templates are a way of doing real macros (or "template metaprogramming|" as
they like to call it). A strange, limited, and clunky feature -- or rather, an
elegant and enormously powerful idea given a strange, limited, and clunky
expression in C++. One of the many potential applications for that feature is
in creating type-safe collections.
Java's generics are a way of not having to write explicit casts. A strange,
limited, and clunky feature -- or rather, a moderately useful idea given a
strange, limited, and clunky expression in Java. One of the few potential
applications for that feature is in creating type-safe collections.
You may not agree (and especially, you may not agree with my value judgements),
but I hope you see what I mean.
Note that the OP's questions were about template applications outside the
overlap with Java's generics.
-- chris
.
- References:
- Java equivalent of C++ Spirit or Boost Graph Library ?
- From: Fab
- Re: Java equivalent of C++ Spirit or Boost Graph Library ?
- From: Chris Uppal
- Re: Java equivalent of C++ Spirit or Boost Graph Library ?
- From: Christopher Benson-Manica
- Java equivalent of C++ Spirit or Boost Graph Library ?
- Prev by Date: Re: HSQLDB in memory DB producing local files ...
- Next by Date: Re: mutate an object or create a new one?
- Previous by thread: Re: Java equivalent of C++ Spirit or Boost Graph Library ?
- Next by thread: Re: Java equivalent of C++ Spirit or Boost Graph Library ?
- Index(es):
Relevant Pages
|