« first day (164 days earlier)      last day (2695 days later) » 

nwp
12:03 AM
@Schbabako which error?
MyClass res; cannot compile because MyClass has no default constructor.
 
It says "No matching constructor for initialization 'MyClass'
 
nwp
if it says that for the MyClass res; line than that would be it
 
When i put a default constructor into the class it says:
Constructor for 'MyClass' must explicitly initialize the const member 'constVar'
 
nwp
well, then do that
 
i did
 
nwp
12:06 AM
apparently the compiler thinks you didn't
 
Ah
ok here is the thing
when i use the default constructor i cant use a variable to pass a number into my constvar form my overloaded operator
i have to explicitly use a number
 MyClass() : constVar(1) {}
This is what i used. Before i tried to keep it with variable like
MyClass(int x) : constVar(x) {}
When i then tried to init this constructor in my overloading part it gave my this error
 
nwp
so what is the goal here? Should MyClass have a default constructor or should MyClass res; be MyClass res{constVar}; instead?
 
It wants me to change my name 'res' to ref which makes no sense
i wanted to use a variable
   MyClass(int x) : constVar(x) {}
but i cant use it
why?
MyClass operator+(MyClass &obj)
    {
        MyClass(19) res;
        res.var= this->var+obj.var;
        return res;
    }
this doesnt work then
 
nwp
yeah, MyClass(19) res; is the wrong syntax
try MyClass res(19);
 
ohhhh
THANKS
damn :D why did i try to give variables to the type itself :D
its like i tried to do this
  int(3) x
 
 
20 hours later…
8:26 PM
hello, im trying to count all '\n' characters from the beggining of string to the position given by find_of another string inside of this string, but this one seems not to work :/
std::count(document.begin(), document.substr(0,document.find(it->str(), INT32_MAX)).end(), '\n')
 
nwp
8:40 PM
@Dartek12 what is the INT32_MAX supposed to do?
 
9:01 PM
aww I've mistook it
i've fixed it and it works
 
Hey guys
 
hey huys
guy*
 
lol
 
such slips are not really funny
 
yes sir
 
9:06 PM
ahh, such a hopeless algo
how can I replace 1 or more whitespace character with one space (' ')?
 

« first day (164 days earlier)      last day (2695 days later) »