[PATCH] Make tooling::Range more convenient.

Manuel Klimek klimek at google.com
Tue Jul 16 10:51:38 PDT 2013


  I pretty strongly oppose this change. I don't think the convenience it adds for callers is worth the additional complexity of the class.
  Especially:
  - offset + length is easy to write; if we think we need end more often then length, we should add end and remove length
  - Range is a immutable object by design; in my experience immutable value objects in public interfaces make it easier to reason about the code...

  I'm curious why you don't want to create new Range objects in the cpp migrator code, like this:
  Range R(...);
  // and if you really want to change it:
  R = Range(NewOffset, NewLength);

http://llvm-reviews.chandlerc.com/D1156



More information about the cfe-commits mailing list