Herb Sutter wrote:
> In practice, many
> programmers using a C++/CLI-enabled compiler (currently Visual C++
> 2005) are simply taking advantage of the ability to seamlessly use
> existing CLI types with their C++ code, which typically requires no
> extended syntax at all beyond a sprinkling of gcnew and ^.
just a question: is it possible to gcnew a C++ type (that is the one
with C++ semantics, defined without use of C++/CLI keywords)? If not,
then I would argue with you that this process "sprinkling with gcnew and
^" will actually mean one of two (or both):
- significant change of semantics of class being constructed due to
addition of "value" or "ref" prefix in front of class definition, as CLI
types have much different semantics than C++ class
- creation of C++/CLI wrappers that will own native C++ cl***** and will
provide CLI-compliant semantics without change to actual C++ code and
semantics of C++ types used in the program
I would also argue that first alternative is dangerous one, as it takes
away many of C++ guarantees from existing C++ code (eg. concerning
object livetime, const correctness etc) that the programmer had in mind
when writing the original code.
B.
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


|