built_in_type_conversion.cpp

This commit is contained in:
2014-05-31 21:47:11 +04:00
parent c3cdc8f828
commit 77b0af4a5d

View File

@@ -0,0 +1,68 @@
/* Check cf5-opt.vim defs.
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
VIM: let g:cppflags=g:Iboost.g:Itbb
VIM: let g:ldflags=g:Lboost.g:Ltbb.g:tbbmalloc.g:tbbmproxy
VIM: let g:ldlibpath=g:Bboost.g:Btbb
VIM: let g:argv=""
VIM-: let g:cf5output=0
*/
#include <iostream>
#include <exception>
void prom( long long )
{
std::cout << "prom" << std::endl;
}
void fpprom( double )
{
std::cout << "fpprom" << std::endl;
}
void integral( short )
{
std::cout << "integral" << std::endl;
}
void conv_double( float )
{
std::cout << "conv_double" << std::endl;
}
void fpint( int )
{
std::cout << "fpint" << std::endl;
}
void fpint2( float )
{
std::cout << "fpint2" << std::endl;
}
int main ( void )
{try{
prom( short(10) );
fpprom( float(1.) );
integral( int(100000) );
conv_double( double(10ll) );
fpint( float(1.) );
fpint( double(2.) );
fpint2( int(2) );
return 0;
}
catch ( const std::exception& e )
{
std::cerr << std::endl
<< "std::exception(\"" << e.what() << "\")." << std::endl;
return 2;
}
catch ( ... )
{
std::cerr << std::endl
<< "unknown exception." << std::endl;
return 1;
}}