Kole's blog

By Kole, history, 8 years ago, In English

I saw in someone's code declaration for struct like this, but I forgot how exactly. Does somebody maybe know how it should be written correctly?

struct Interval
{
   int l, r;
   Interval() l(), r() {}
   Interval(int _l, int _r) l(_l), r(_r) {}
}
  • Vote: I like it
  • +4
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Kole (previous revision, new revision, compare).

»
8 years ago, # |
  Vote: I like it +21 Vote: I do not like it

Interval() : l(), r() {} Interval(int _l, int _r) : l(_l), r(_r) {}