An open API service indexing awesome lists of open source software.

https://github.com/kei-g/truth

No conditional branch
https://github.com/kei-g/truth

cpp

Last synced: 3 months ago
JSON representation

No conditional branch

Awesome Lists containing this project

README

        

# `truth` - No conditional branch

To decrease cyclomatic complexity

## Positive Case, Before

```cpp
if (expression) {
/* Something you want to do */
}
```

## Positive Case, After

```cpp
#include "truth.hpp"

algorithm::when(expression, []() { /* Something you want to do */ });
```

or

## Negative Case, Before

```cpp
if (!expression) {
/* Something you want to do */
}
```

## Negative Case, After

```cpp
#include "truth.hpp"

algorithm::unless(expession, []() { /* Something you want to do */ });
```

[![License](https://img.shields.io/github/license/kei-g/truth?style=plastic)](https://opensource.org/licenses/BSD-3-Clause)