Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there safe_cast in the standard c++?

Tags:

c++

visual-c++

It looks like there is a safe_cast in the visual c++, which looks similar to dynamic_cast.

I am wondering if safe_cast is in the standard c++?

like image 200
Adam Lee Avatar asked Dec 01 '13 14:12

Adam Lee


2 Answers

safe_cast is used in C++/CLI. There is no such standard construction in C++.

like image 110
Vlad from Moscow Avatar answered Oct 07 '22 22:10

Vlad from Moscow


safe_cast is not standard c++ type casting. Only 4 casting operators available

1.dynamic_cast <new_type> (expression)
2.reinterpret_cast <new_type> (expression)
3.static_cast <new_type> (expression)
4.const_cast <new_type> (expression)
like image 21
Abu Yousuf Avatar answered Oct 07 '22 22:10

Abu Yousuf