For Programmers: Free Programming Magazines  


Home > Archive > VC STL > January 2006 > changes in xutility and xmemory from vc7 to vc8









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author changes in xutility and xmemory from vc7 to vc8
Hauke001

2006-01-09, 11:10 pm

Certain member and class definitions have changed or been removed altogether
in the latest shipped version (vc8);

for example,
- the class _PtrIt is no longer defined in xutility
- the typename _TEMPLATE_MEMBER is no longer defined in xmemory and has
been changed to template.

This means that certain std:: based code will no longer compile and needs to
be re-written and re-tested.
Firstly, is there a comprehensive source of information where the changes
are fully documented?
Secondly, why??

Regards


Stephen Howe

2006-01-09, 11:10 pm

> This means that certain std:: based code will no longer compile and needs
to
> be re-written ...


Why? _PtrIt is an implementation detail, not part of standard C++.
Programmers have no business using it and that those that do run their own
risks.

> Firstly, is there a comprehensive source of information where the changes
> are fully documented?


All that _should_ matter is whether the public interface as documentated in
standard has changed.
And I don't think it has.
[color=darkred]

Well, compilers vendors may change library implementations behind the
scenes.
It may well be that goodies like increased performance, checked iterators
etc appear.
If the implementation details to achieve that get changed between versions,
that is neither here nor there.
All that _SHOULD_ matter is conformance to the standard.

Stephen Howe


Igor Tandetnik

2006-01-09, 11:10 pm

Hauke001 <Hauke001@discussions.microsoft.com> wrote:
> Certain member and class definitions have changed or been removed
> altogether in the latest shipped version (vc8);
>
> for example,
> - the class _PtrIt is no longer defined in xutility
> - the typename _TEMPLATE_MEMBER is no longer defined in xmemory and
> has been changed to template.
>
> This means that certain std:: based code will no longer compile and
> needs to be re-written and re-tested.


Any identifier that starts with an underscore followed by capital letter
is reserved for implementation. Your code has no business relying on
these implementation details. If it does, it deserves to be broken: it
is not valid C++ in the first place. You should rewrite it using
standardized and documented facilities of the language.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


Tom Widmer [VC++ MVP]

2006-01-09, 11:10 pm

Hauke001 wrote:
> Certain member and class definitions have changed or been removed altogether
> in the latest shipped version (vc8);
>
> for example,
> - the class _PtrIt is no longer defined in xutility
> - the typename _TEMPLATE_MEMBER is no longer defined in xmemory and has
> been changed to template.
>
> This means that certain std:: based code will no longer compile and needs to
> be re-written and re-tested.


Can you give an example? I can't envisage what code this could effect.
The things you mention above are implementation details that use
implementation private names (they start with an _ and an uppercase
letter), so your code should be completely safe from changes to them.
<xutility> is a private implementation header in any case, and might be
removed entirely between compiler/library versions. If you switch
standard libraries, you won't get it either (e.g. www.stlport.com).

> Firstly, is there a comprehensive source of information where the changes
> are fully documented?


Everything you can use is well documented in MSDN. If you use anything
undocumented, you're on your own of course, but I can't think of a
reason to do so.

> Secondly, why??


Sorry, I don't understand why you don't expect implementation updates
between versions (and even service packs).

Tom
Stephen Howe

2006-01-09, 11:10 pm

> for example,
> - the class _PtrIt is no longer defined in xutility
> - the typename _TEMPLATE_MEMBER is no longer defined in xmemory and has
> been changed to template.


If you have relied on _PtrIt to achieve something in your code, the best
question to ask here would be something like:

"I am using _PtrIt to achieve .... [fill in blanks]. Is there a way of
achieving the same effect but with standard C++ code (because if so that
should work for all C++ compiler versions and with C++ compilers from
different vendors)?"

Doing so means you are not locked into a specific version from a specific
vendor, a definite minus (as you have discovered).

You want, at all costs, to write code that is standard C++ and avoid
implementation specifics as much as possible.

Cheers

Stephen Howe


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com