online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include "class.h" int main() { Property<int> num; num = 100; std::cout << num << "\n"; }
#ifndef MYCLASS_H #define MYCLASS_H template <class PropertyType> class Property { PropertyType m_property; public: const PropertyType& operator=(const PropertyType& value); template<typename T> //parameter cluase added here //---------------------------------------------------vvvvv----------------------->const added here friend std::ostream& operator<<(std::ostream& os,const Property<T>& other); }; template <class PropertyType> const PropertyType& Property<PropertyType>::operator=(const PropertyType& value) { m_property = value; return m_property; } template <class PropertyType> //----------------------------------------vvvvv---------------------------------->const added here std::ostream& operator<<(std::ostream& os,const Property<PropertyType>& other) { os << other.m_property; return os; } template class Property<int>; #endif

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