Project

General

Profile

Actions

Task #2132

closed

code-style: assert

Added by Junxiao Shi about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Docs
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
0.50 h

Description

Add code style rule for assert vs BOOST_ASSERT, static_assert vs BOOST_STATIC_ASSERT.


Related issues 1 (0 open1 closed)

Blocks ndn-cxx - Task #1983: Ensure Element::Error inherits from tlv::ErrorClosedJunxiao Shi

Actions
Actions #1

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?

Actions #2

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...

Actions #3

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.

Actions #4

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.

Actions #5

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)

Actions #6

Updated by Junxiao Shi about 10 years ago

  • Status changed from New to In Progress
Actions #7

Updated by Junxiao Shi about 10 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
Actions #8

Updated by Junxiao Shi about 10 years ago

  • Blocks Task #1983: Ensure Element::Error inherits from tlv::Error added
Actions #9

Updated by Junxiao Shi about 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF