Reputation

Privileges

Members need to achieve at least one of the given member levels in the given reputation
categories in order to perform a given action. For example, to store personal files in your
account area you will need to achieve Platinum level in either the Author or Authority category.
The "If Owner" column means that owners of an item automatically have the privilege. The
member types column lists member types who gain the privilege regardless of their reputation
level.

Six years ago I wrote a short series of aticles about the three Standard C++ features not implemented by Visual C++ 7.1. Interestingly[^] one of these three features is being removed from the standard (keyword export) and another deprecated (exception specifications).

Ever since ATL Server[^] was moved to CodePlex, we have had no native SOAP library from Microsoft. Now, there is Windows Web Services API (WWSAPI)[^] which comes preinstalled on Windows 7 and Windows Server 2008, but can be separatelly installed even on XP.

I'm about to do a live demonstration on tomorrow's Microsoft Tech Ed about this stuff, along with other features of Win7. I hadn't known that I can separately install it on an XP machine. Thanks for enlightening me.

Also, there are Boost Statechart[^] for easy coding of finite state machines, Expressive[^], a regex library that enables compile time regexes and Boost.Typeof[^] that offers a library-based alternative to the typeof keyword, planned to be introduced in the next version of the Standard.

As for the library updates, I find the performance optimization of Boost.Function significant - now it doesn't use heap at all in some cases.

This is the result of the standard behavior of default copy constructors:

The implicitly-defined copy constructor for class X performs a member-
wise copy of its subobjects. The order of copying is the same as the
order of initialization of bases and members in a user-defined con-
structor (see _class.base.init_). Each subobject is copied in the
manner appropriate to its type:

--if the subobject is of class type, the copy constructor for the
class is used;

--if the subobject is an array, each element is copied, in the manner
appropriate to the element type;

--if the subobject is of scalar type, the built-in assignment operator
is used.

That a copy constructor is only called when initalizing a variable in the declaration. If this is true it seems like the code above declares b, then does b = a which would not call the copy constructor.

I compiled and tested your code and it does work so is the link above wrong or am I missing something.

I agree with you about always learning something new with c++. I'm fairly new to it so finding something to learn is easy but it even seems like once I think I know all there is to know about even a part of the language there is yet more to it. Really interesting and fun.

That a copy constructor is only called when initalizing a variable in the declaration. If this is true it seems like the code above declares b, then does b = a which would not call the copy constructor.

Argh, you are right. My sample should really be:

test b = a;

However, it still works because the same logic applies for the default assignment operator.

Many developers are shocked by a drop in performance when upgrading an application that uses STL from VC 2003 to VC 2005. The reason for this is that the MS version of the Standard Library has checked iterators[^]switched on by default even in release mode. To turn this feature off, define _SECURE_SCL to be 0 in your project settings; the performance gain is impressive.

According to Herb Sutter's PDC presentation[^], for each syntax in C++0x will most likely be modeled after Java, and not after C# or C++/CLI. It may be we will write something like:

for each (int i : v) {...}

rather than

for each (int i in v) {...}

Two small remarks from my side:

1. Isn't C++ too expressive already? I know the C++ standard comitee is very reluctant to introduce new keywords, but the price is too often reduced readability.
2. Is C++ now catching up with Java and C#? Of course, with all these millions of existing lines of code written in C++, being conservative is the only way to go, but where is the fine line between the helthy dose of conservativism and becoming obsolete? For instance, C# 3.0 is getting lambda expressions, and it is going to be released probably in a couple of years. The next version of C++, optimistically called C++0x which may or may not include lambda expressions is far from being adopted, and even when it happens, how long will it take for major compiler vendors to implement its features?

I'd heard some noises that this library solution (and its horrible complexity inside) may serve as proof of feasability and as s hint of real world need, helping to get "native" construct into the language. If that ever happens it'll be years and years from now, though.

One of the language features that are likely to get included into the next version of the standard is type inference. Namely, if the compiler can deduce the type of the variable, we can declare it with keyword auto:

auto i = 1;

Many people confuse type inference with variant types, but it is not the case. In the sample above, i is declared as int, not variant. In other words, it is exactly equivalent to:

int i = 1;

Type inference is also going to be included in C# 3.0, but the choice of the keyword is very unfortunate: var. For instance the same construct:

var i = 1;

means one thing in JavaScript (i is variant) and another in C# (i is int)

How is this useful? It can save us a lot of typing, and annoying syntax errors. Say we have:

when a programmer knows what he does, yes, it can be safely hidden and the choice can be let to the compiler, but what i see is that rarely programmers (mostly beginners, but hey, programmers anyway) know exactly what the compiler does with their code (implicit conversions, implicit operators calls, etc...).
if we let the choice to the compiler to choose the most appropriated type to a variable, such as variants, then we will loose the power - i fell - of C++, joining the VB road...

Nemanja Trifunovic wrote:

How is this useful? It can save us a lot of typing, and annoying syntax errors. Say we have:

as i was saying, just know what you do while code, and everything should be ok...

if we let the choice to the compiler to choose the most appropriated type to a variable, such as variants, then we will loose the power - i fell - of C++, joining the VB road...

But there is a big difference: C++ is still statically typed language, and type inference does not mean variants. If someone makes a mistake about the infered type, he will be greeted by a compiler error. With variants, one would end up with a run-time error, which is much worse.

In general, I try to be somewhat conservative when it comes to adopting new technologies in production work. Sure, it is important to stay informed and try all the latest buzz, but for the work that actually brings food to the table I prefer widely adopted and well tested tools.

Having said all that, I spent last couple of days porting the client side of a distributed linguistic application from VC++ 6.0 to VC++ 8.0 (aka VC++ 2005), and the later was released a couple of weeks ago. That was a two-step operation: first I did the port from 6.0 to 7.1 which I know very well, and once it compiled there, another step was from 7.1 to 8.0.

It was somewhat surprising how many errors appeared in the second step. Most of them actually come from unstandard programming practices that originate in VC 6.0, but were tolerated in VC 7.1 (declarations within for loops, wchar_t a typedef for unsigned short,...), but some of them are really surprising. For instance, I found out that some libraries (xalan, crypto++) compile fine in Release mode, but in compile mode they report compile error C2678 somewhere from xutility. The solution is not exactly obvious: adding a preprocessor definition _HAS_ITERATOR_DEBUGGING=0.

All in all, I like VC 2005 so far. The compiler is better, and IDE has some nice new features: Error window, graying out "ifdef-ed" code, Intelisense is better than ever. The interesting question is C++/CLI. Is it going to be adopted among developers? I wish it did, but frankly it would surprise me: C++ developers don't need .NET, and .NET developers don't know what to do with C++.