Opened 17 years ago
Closed 17 years ago
#105 closed defect (wontfix)
remove asserts in header files
Reported by: | Peter | Owned by: | Peter |
---|---|---|---|
Priority: | major | Milestone: | yat 0.3 (Public release) |
Component: | classifier | Version: | trunk |
Keywords: | Cc: |
Description
I don't think it's good style to have asserts in header files. The reason is simply that if you have installed the lib without sanity checks then you expect the yat to don perform any sanity check. This is not the case for the assert in the header files as this code is compile post-installation. See Stroustrup for further discussion.
Change History (7)
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
After all asserts in headerfiles e.g. in access operators are quite efficient in tracking down bugs. However using the standard assert is not optimal as the user should be able to turn on and off that with -DNDEBUG without affecting the nehaviour of the library. A compromise could be to implement our own assert function (see Stroustrup for details) and these are turned on/off with something like #define YAT_ASSERT and by default these are turned of but running configure with some developer flag the YAT_ASSERT is turned on.
Just an idea. What do you think?
comment:3 Changed 17 years ago by
Milestone: | later → 0.3 (Public release) |
---|
comment:5 follow-up: 6 Changed 17 years ago by
comment:6 Changed 17 years ago by
Replying to peter:
Replying to jari:
Is the decision to go with YAT_ASSEERT?
Obviously, I think it is the way to go.
In a code base without inline functions there would not be a need for YAT_ASSERT! However, we still have inline functions.
Anyhow, I think we should go for YAT_ASSERTs with documentation for how to use it.
comment:7 Changed 17 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This issue will go away once ticket:170 is fixed.
(In [619]) fixes #107 and refs #105 fixed bug in EnsembleBuilder? and removed some assert in header files