Task #2132
closedcode-style: assert
100%
Description
Add code style rule for assert vs BOOST_ASSERT, static_assert vs BOOST_STATIC_ASSERT.
Updated by Junxiao Shi about 10 years ago
I would preferred BOOST_*, because they are upper case and more eye-catching.
Are there different opinions?
Updated by Davide Pesavento about 10 years ago
I would use the standard version. You can always #define NDN_ASSERT assert
if you like uppercase, but I don't really understand nor agree with the "eye-catching" rationale...
Updated by Yingdi Yu about 10 years ago
I would agree with Davide. Given we should "eventually" replace all the BOOST stuff with stl, we should introduce as few BOOST things as possible. Defining an NDN_ASSERT macro seems a good solution.
Updated by Junxiao Shi about 10 years ago
Don't introduce new identifiers.
If BOOST_*
is undesirable, we should prefer plain assert
and static_assert
.
Updated by Alex Afanasyev about 10 years ago
I don't mind using static_assert
instead of BOOST_STATIC_ASSERT
, but would prefer using boost's BOOST_ASSERT
and BOOST_ASSERT_MSG
as they provide more functionality than standard assert (http://www.boost.org/doc/libs/1_55_0/libs/utility/assert.html)
Updated by Junxiao Shi about 10 years ago
- Status changed from New to In Progress
Updated by Junxiao Shi about 10 years ago
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
Updated by Junxiao Shi about 10 years ago
- Blocks Task #1983: Ensure Element::Error inherits from tlv::Error added
Updated by Junxiao Shi about 10 years ago
- Status changed from Code review to Closed