/* Copyright Paul A. Bristow 2011 Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) \file \brief Test program to establish that toolsets work OK, including use of Boost library config and version. */ #include // for BOOST_PLATFORM, BOOST_COMPILER, BOOST_STDLIB ... #include // for BOOST_MSVC versions. #include #include // boost::exception #include #include #include #include int main() { try { std::cout << "Hello Boost!" << std::endl; std::cout << "Platform: " << BOOST_PLATFORM << '\n' << "Compiler: " << BOOST_COMPILER << '\n' << "STL : " << BOOST_STDLIB << '\n' << "Boost : " << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << std::endl; std::cout << "Processor type: " ; #ifdef _MSC_VER std::cout << "_MSC_FULL_VER = " << _MSC_FULL_VER << std::endl; // VS 2015 190023026 #if defined _M_IX86 std::cout << "(x86)" << std::endl; #endif #if defined _M_X64 std::cout << " (x64)" << std::endl; #endif #if defined _M_IA64 std::cout << " (Itanium)" << std::endl; #endif // Something very wrong if more than one is defined (so show them in all just in case)! #endif // _MSC_VER } catch (std::exception& ex) { std::cout << ex.what() << std::endl; } std::cout << "Example of using std::exception." << std::endl; std::string s("Message 1!"); try { throw std::runtime_error("Bummer!"); } catch (std::exception& ex) { std::cout << ex.what() << std::endl; // "Message 1!" } } // int main() /* Typical output: Hello Boost! Platform: Win32 Compiler: Microsoft Visual C++ version 14.0 STL : Dinkumware standard library version 650 Boost : 1.60.0 Processor type: _MSC_FULL_VER = 190023725 (x86) Example of using std::exception. Bummer! EXIT STATUS: 0 Hello Boost! Platform: Win32 Compiler: GNU C++ version 4.8.1 STL : GNU libstdc++ version 20130531 Boost : 1.60.0 Processor type: (x64) Example of using std::exception. Bummer! EXIT STATUS: 0 Hello Boost! Platform: Win32 Compiler: Clang version 3.8.0 (branches/release_38) STL : Dinkumware standard library version 650 Boost : 1.60.0 Processor type: _MSC_FULL_VER = 190000000 (x64) Example of using std::exception. Bummer! EXIT STATUS: 0 */