Re: [PATCH] CT 20

2006-06-07 Thread Angus Leeming
Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: > | No, enum is NOT type-safe. I started with something like > Enums are type-safe, but also convertible to an integer type. > (but not from integer to enum) Hi, guys. You might find this interesting/useful: http://cryp.to/smart-enum/libs/smart_enum

Re: [PATCH] CT 20

2006-06-07 Thread Lars Gullik Bjønnes
Michael Gerz <[EMAIL PROTECTED]> writes: | Angus Leeming wrote: | | >Michael Gerz <[EMAIL PROTECTED]> writes: | > | >> After having introduced the enum in the last two hours, I finally | >> come to the conclusion that a simple bool type is more suitable | >> than an enum type for which C++ does n

Re: [PATCH] CT 20

2006-06-07 Thread Michael Gerz
Angus Leeming wrote: Michael Gerz <[EMAIL PROTECTED]> writes: After having introduced the enum in the last two hours, I finally come to the conclusion that a simple bool type is more suitable than an enum type for which C++ does not provide any type-safety. There are just two values, on an

Re: [PATCH] CT 20

2006-06-06 Thread Lars Gullik Bjønnes
Michael Gerz <[EMAIL PROTECTED]> writes: | Lars Gullik Bjønnes wrote: | | >Michael Gerz <[EMAIL PROTECTED]> writes: | > | >|&& oldpar.isLineSeparator(old.pos()) | >|&& oldpar.isLineSeparator(old.pos() - 1) | >|&& oldpar.lookupChange(old.pos() - 1).t

Re: [PATCH] CT 20

2006-06-06 Thread Angus Leeming
Michael Gerz <[EMAIL PROTECTED]> writes: > After having introduced the enum in the last two hours, I finally come > to the conclusion that a simple bool type is more suitable than an enum > type for which C++ does not provide any type-safety. There are just two > values, on and off. That's what

Re: [PATCH] CT 20

2006-06-06 Thread Michael Gerz
Lars Gullik Bjønnes wrote: | I think I hate the comment. :-) | | Perhaps we should use a enum to make the code in itself clearer. | | oldpar.erase(old.pos() - 1, Tracking::Off); | | or something. Or just drop the comment and have people learn the api's. After having introduced the enum i

Re: [PATCH] CT 20

2006-06-06 Thread Angus Leeming
Michael Gerz <[EMAIL PROTECTED]> writes: > Question: Should "off" be "OFF"? The coding rules suggest "off" for enum > values, however upper case is used all over the place. OFF tends to upset LARS who prefers not to shout and thinks that all upper case should be used only for MACROS. So keep him

Re: [PATCH] CT 20

2006-06-06 Thread Michael Gerz
Lars Gullik Bjønnes wrote: Michael Gerz <[EMAIL PROTECTED]> writes: | && oldpar.isLineSeparator(old.pos()) | && oldpar.isLineSeparator(old.pos() - 1) | && oldpar.lookupChange(old.pos() - 1).type != Change::DELETED) { | -

Re: [PATCH] CT 20

2006-06-05 Thread Lars Gullik Bjønnes
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: | Michael Gerz <[EMAIL PROTECTED]> writes: | | | && oldpar.isLineSeparator(old.pos()) | | && oldpar.isLineSeparator(old.pos() - 1) | | && oldpar.lookupChange(old.pos() - 1).type != Change::DELETED) {

Re: [PATCH] CT 20

2006-06-05 Thread Lars Gullik Bjønnes
Michael Gerz <[EMAIL PROTECTED]> writes: | && oldpar.isLineSeparator(old.pos()) | && oldpar.isLineSeparator(old.pos() - 1) | && oldpar.lookupChange(old.pos() - 1).type != Change::DELETED) { | - // We need to set the text to

[PATCH] CT 20

2006-06-04 Thread Michael Gerz
Hi, this fixes change tracking in text2.C: fix calls to Paragraph::insertInset() and Paragraph::erase() Michael Index: text2.C === --- text2.C (Revision 13990) +++ text2.C (Arbeitskopie) @@ -617,7 +617,9 @@ { BOOST_ASSERT(this