On Mon, Apr 4, 2016 at 11:33 AM, John McCall via cfe-commits < cfe-commits@lists.llvm.org> wrote:
> Author: rjmccall > Date: Mon Apr 4 13:33:00 2016 > New Revision: 265323 > > URL: http://llvm.org/viewvc/llvm-project?rev=265323&view=rev > Log: > Add a couple of convenience operations to CharUnits. > > Modified: > cfe/trunk/include/clang/AST/CharUnits.h > > Modified: cfe/trunk/include/clang/AST/CharUnits.h > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CharUnits.h?rev=265323&r1=265322&r2=265323&view=diff > > ============================================================================== > --- cfe/trunk/include/clang/AST/CharUnits.h (original) > +++ cfe/trunk/include/clang/AST/CharUnits.h Mon Apr 4 13:33:00 2016 > @@ -142,9 +142,17 @@ namespace clang { > CharUnits operator* (QuantityType N) const { > return CharUnits(Quantity * N); > } > + CharUnits &operator*= (QuantityType N) { > + Quantity *= N; > + return *this; > + } > CharUnits operator/ (QuantityType N) const { > return CharUnits(Quantity / N); > } > + CharUnits operator/= (QuantityType N) { > Should this return type be a reference like the one for operator*=? -- Sean Silva > + Quantity /= N; > + return *this; > + } > QuantityType operator/ (const CharUnits &Other) const { > return Quantity / Other.Quantity; > } > > > _______________________________________________ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits