Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: C++
Posted by: Yan Anisimov
Added: May 17, 2018 11:25 AM
Views: 18
Tags: no tags
  1. #include<iostream>
  2.  
  3. class Logger3{
  4.     private:
  5.     bool i;
  6.     public:
  7.         Logger3(bool z)
  8.         {
  9.             this->i=z;
  10.         }
  11.         template <typename T>
  12.         Logger3& operator<<(T a) {
  13.             if (this->i){
  14.     std::cout << "INFO:" << a;}
  15.     return *this;
  16. }};