tags:

views:

340

answers:

5

I've heard of static_cast operator

Recently I've come across static_case, for instance:

*ppv = static_case<IUnknown>

What does this mean?

A: 

Its good old C cast with a new C++ syntax similar to other C++ cast like dynamic_cast. The only advantage I know is just being consistent and also it's easy to grep it.

CPP Ref: http://www.cppreference.com/wiki/keywords/static_cast

Stroustrup on static_cast: http://www.research.att.com/~bs/bs_faq2.html#static-cast

Nazgob
Any info on static_case, specifically?
Aaron
Updated my response, check out the links but not really. It's just casting a type from one to other without any fancy features.
Nazgob
You're missing the point. He's asking about *static_case* not static_cast.
Graeme Perrow
There is no static_case AFAIK... I assumed it's a typo.
Nazgob
+7  A: 

It's a typo : there is no static_case, only static_cast, dynamic_cast, const_cast and reinterpret_cast.

You can see on google that the docs where you find "static_case" have typos and use static_cast and static_case like if it was the same word.

To be sure, just try to use static_case in available compilers.

Klaim
Nice - thanks Klaim - I'll keep the question up in case others get confused... I'm new to C++
Aaron
No problem. May I suggest you try using example of keyword usage in you compiler before asking? That would help you check first it that keyword is a language keyword or a library function (like boost ones) or simply a typo.
Klaim
+2  A: 

There is nothing called static_case in C++. There is just static_cast

Naveen
A: 

Static operator for casting object.It's concept for upcast object and downcast object.If you read inheritance object topic,it's can help you. Casting in c++ : http://www.acm.org/crossroads/xrds3-1/ovp3-1.html

Chatsiri.rat
A: 

the first thing I thought of when I looked at this question - it`s a simple misprint

chester89