Add BOOST_PP_BOOL_true and BOOST_PP_BOOL_false definitions

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
compilers

Research direction

Start by locating the existing BOOST_PP_BOOL implementation and its tests in the preprocessor module. Check how boolean-like macro names are defined and exercised, then add the true and false definitions and verify that BOOST_PP_IF receives 1 or 0 for those inputs.

Written by the indexing model from the issue text.

Description

I suggest to define a new macro

#define BOOST_PP_BOOL_true 1
#define BOOST_PP_BOOL_false 0

for make that possible:

BOOST_PP_IF(BOOST_PP_BOOL(true/false), "YES", "NO")
//          ^-- Expands into 1/0

It seems like simple behavior and I have no idea why its not added yet.

Dominant language
C++
Stars
118
Forks
76
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/preprocessor

All issues in boostorg/preprocessor

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.