You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by "Ben Kietzman (Jira)" <ji...@apache.org> on 2019/10/03 15:24:13 UTC

[jira] [Created] (ARROW-6781) [C++] Improve and consolidate ARROW_CHECK, DCHECK macros

Ben Kietzman created ARROW-6781:
-----------------------------------

             Summary: [C++] Improve and consolidate ARROW_CHECK, DCHECK macros
                 Key: ARROW-6781
                 URL: https://issues.apache.org/jira/browse/ARROW-6781
             Project: Apache Arrow
          Issue Type: Improvement
          Components: C++
            Reporter: Ben Kietzman
            Assignee: Ben Kietzman


Currently we have multiple macros like {{DCHECK_EQ}} and {{DCHECK_LT}} which check various comparisons but don't report anything about their operands. Furthermore, the "stream to assertion" pattern for appending extra info has proven fragile. I propose a new unified macro which can capture operands of comparisons and report them:

{code:cpp}
  int three = 3;
  int five = 5;
  DCHECK(three == five, "extra: ", 1, 2, five);
{code}

Results in check failure messages like:
{code}
F1003 11:12:46.174767  4166 logging_test.cc:141]  Check failed: three == five
  LHS: 3
  RHS: 5
extra: 125
{code}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)