Skip to content

Commit

Permalink
Update readme and value.h examples
Browse files Browse the repository at this point in the history
  • Loading branch information
braxtons12 committed Jan 31, 2024
1 parent 3ed9107 commit cb01ee9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ After following the Quick Start Guide, you'll be able to use hyperion::mpl in yo
A basic example of what you can do with hyperion::mpl is below:

```cpp
#include <hyperion/mpl/list.h>
#include <hyperion/mpl/value.h>

using namespace hyperion::mpl;

constexpr auto val1 = Value<4>{};
constexpr auto val2 = Value<2>{};

constexpr auto meaning_of_life = (val1 * 10_value) + val2;

static_assert(meaning_of_life == 42);
```
### Contributing
Expand Down
2 changes: 2 additions & 0 deletions include/hyperion/mpl/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ HYPERION_IGNORE_DOCUMENTATION_WARNING_START;
/// constexpr auto val2 = Value<2>{};
///
/// constexpr auto meaning_of_life = (val1 * 10_value) + val2;
///
/// static_assert(meaning_of_life == 42);
/// @endcode
/// @headerfile hyperion/mpl/type_traits.h
/// @}
Expand Down

0 comments on commit cb01ee9

Please sign in to comment.