Skip to content

Commit

Permalink
Update documentation and add Travis CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpark committed Sep 13, 2017
1 parent 3ca7782 commit 1a5fb19
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
> Pattern Matching in __C++__.
[![stability][badge.stability]][stability]
[![travis][badge.travis]][travis]
[![license][badge.license]][license]
[![wandbox][badge.wandbox]][wandbox]

[badge.stability]: https://img.shields.io/badge/stability-experimental-orange.svg
[badge.travis]: https://travis-ci.org/mpark/patterns.svg?branch=master
[badge.license]: http://img.shields.io/badge/license-boost-blue.svg
[badge.wandbox]: https://img.shields.io/badge/try%20it-on%20wandbox-5cb85c.svg

[stability]: http://github.com/badges/stability-badges
[travis]: https://travis-ci.org/mpark/patterns
[license]: https://github.com/mpark/patterns/blob/master/LICENSE.md
[wandbox]: https://wandbox.org/permlink/G46QnPBB0OiV5m0N

Expand Down Expand Up @@ -128,6 +131,8 @@ The type `T` satisfies `Product` if given a variable `x` of type `T`,
__NOTE__: These requirements are very similar to the requirements for
[C++17 Structured Bindings][structured-bindings].

[structured-bindings]: http://en.cppreference.com/w/cpp/language/declarations#Structured_binding_declaration

#### Syntax

- `prod(<pattern>...)`
Expand Down Expand Up @@ -278,6 +283,8 @@ match(x)(
This could also be used to implement [C++17 `std::apply`][apply]:
[apply]: http://en.cppreference.com/w/cpp/utility/apply
```cpp
template <typename F, typename Tuple>
decltype(auto) apply(F &&f, Tuple &&t) {
Expand All @@ -289,6 +296,8 @@ decltype(auto) apply(F &&f, Tuple &&t) {

and even [C++17 `std::visit`][visit]:

[visit]: http://en.cppreference.com/w/cpp/utility/variant/visit

```cpp
template <typename F, typename... Vs>
decltype(auto) visit(F &&f, Vs &&... vs) {
Expand Down Expand Up @@ -365,11 +374,31 @@ match(101, 202)(
// prints: "LT".
```

## Requirements

This library requires a standard conformant __C++17__ compiler.
The following compilers are continously tested:

| Compiler | Operating System | Version String |
|----------------------------------------|---------------------------------------------|-----------------------------------------------------------------------------------------|
| GCC 7.2.0 | Ubuntu 14.04.5 LTS | g++-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 |
| Clang 5.0.0 | Ubuntu 14.04.5 LTS | clang version 5.0.0-svn312333-1~exp1 (branches/release_50) |

## CMake Variables

- __`MPARK_PATTERNS_INCLUDE_TESTS`__:`BOOL` (__default__: `OFF`)

Build tests.

## Unit Tests

Refer to [test/README.md](test/README.md).

## License

Distributed under the [Boost Software License, Version 1.0](LICENSE.md).

## Related Work

- [solodon4/Mach7](https://github.com/solodon4/Mach7)
- [jbandela/simple_match](https://github.com/jbandela/simple_match/)

[apply]: http://en.cppreference.com/w/cpp/utility/apply
[visit]: http://en.cppreference.com/w/cpp/utility/variant/visit
[structured-bindings]: http://en.cppreference.com/w/cpp/language/declarations#Structured_binding_declaration
9 changes: 9 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,30 @@
> Pattern Matching in __C++__.
[![stability][badge.stability]][stability]
[![travis][badge.travis]][travis]
[![license][badge.license]][license]
[![wandbox][badge.wandbox]][wandbox]

[badge.stability]: https://img.shields.io/badge/stability-experimental-orange.svg
[badge.travis]: https://travis-ci.org/mpark/patterns.svg?branch=master
[badge.license]: http://img.shields.io/badge/license-boost-blue.svg
[badge.wandbox]: https://img.shields.io/badge/try%20it-on%20wandbox-5cb85c.svg

[stability]: http://github.com/badges/stability-badges
[travis]: https://travis-ci.org/mpark/patterns
[license]: https://github.com/mpark/patterns/blob/master/LICENSE.md
[wandbox]: https://wandbox.org/permlink/G46QnPBB0OiV5m0N

## Test

This directory contains the tests for __MPark.Patterns__.

## CMake Variables

- __`MPARK_PATTERNS_EXCEPTIONS`__:`BOOL` (__default__: `ON`)

Build the tests with exceptions support.

### Building and Running Tests

Execute the following commands from the top-level directory:
Expand Down

0 comments on commit 1a5fb19

Please sign in to comment.