online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <sstream> template<typename type_t> struct as_scientific { explicit as_scientific(type_t& v) : value{v}{}; type_t value; }; template<typename type_t> std::ostream& operator<<(std::ostream& os, const as_scientific<type_t>& scientific) { os << std::scientific << "((" << typeid(type_t).name() << ")(" << scientific.value << ")"; return os; } int main() { double d = 12.3; std::ostringstream s; s << "Hello World " << as_scientific{d} << "what a nice day."; std::cout << s.str() << "\n"; // or directly std::cout << as_scientific{d} << "\n"; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue