Re: Java equivalent of C++ Spirit or Boost Graph Library ?



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


.



Relevant Pages

  • Re: VS 2005 : "Error when trying to run project"??
    ... The host process is enabled by default and it is a feature of visual studio ... Try to disable vs hosting process on project properties, Debug Tab... ... Another strange answer googling is Enable Terminal server services ?! ...
    (microsoft.public.dotnet.general)
  • Re: Workstation only sees 1 network share
    ... strange that it was enabled, as joining a machine to the domain turns this ... feature off. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Signed and Unsigned integers in Tcl
    ... That's indeed strange, especially as it also happens in Tcl8.4 ... It appears to be a "feature" more than a bug, ... set value [format %x $value] ... You'd also have to prepend the 0x, of course, but yes. ...
    (comp.lang.tcl)
  • Re: Yum nit-pick !
    ... bar) What seems strange to me is, why is this feature available with ... yum but not with packagekit? ...
    (Fedora)
  • Re: Bug in SeisLab s_wplot function?
    ... Richard Lacoss wrote: ... Does not look like a feature to me. ... Strange that I have not seen it ... Prev by Date: ...
    (comp.soft-sys.matlab)