Description:-
boost::operator:: addable function used to add the operands.
Header file:-
#include <boost/operators.hpp>
Syntax:-
T operator+(const T&, const T&)
where,
T is the return type of the function, T maybe the class name/structure name /template name,
operator is the keyword,
+ is used for addition,
const T&, const T&:-they are the two objects of templates/class/structure. We need two parameters to add that's why we are passing two parameters in form of objects.
Sample code:-
1 | #include <boost/operators.hpp> |
Output:-
11
Comments