diff --git a/built_in_type_conversion.cpp b/built_in_type_conversion.cpp new file mode 100644 index 0000000..8959f36 --- /dev/null +++ b/built_in_type_conversion.cpp @@ -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 +#include + +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; +}} +