1# Facebook Template Library [![Build Status](https://secure.travis-ci.org/facebook/fatal.png?branch=master "Build Status")](https://travis-ci.org/facebook/fatal)
2Fatal (Facebook Template Library) is a library for fast prototyping software in modern C++.
3
4It provides facilities heavily based on template meta-programming, while keeping most of the complexity under-the-hood, to enhance the expressive power of C++.
5
6Fatal also provides lessons on how to write meta-programs, as well as on how to make the best use of the library, starting at beginner levels.
7
8The goal is make its benefits available to a wider audience other than just hard-core library writers.
9
10
11## Documentation and Examples
12A learn-by-example guide is available under the [`lesson/`](lesson/) directory.
13
14Demo programs are also available under the [`demo/`](demo/) directory.
15
16Extensive documentation with examples can be found inline in the source header files.
17
18
19## Building Fatal
20Fatal is a header only library, therefore no building is required.
21
22
23## Requirements
24A compliant C++14 compiler. Currently tested under Clang {[3.5](https://packages.debian.org/sid/clang-3.5), [3.6](https://packages.debian.org/sid/clang-3.6), [3.7](https://packages.debian.org/sid/clang-3.7), [3.8](https://packages.debian.org/sid/clang-3.8), [3.9](https://packages.debian.org/sid/clang-3.9), [5.0](https://packages.debian.org/sid/clang-5.0)} and GCC {[5](https://packages.debian.org/sid/g++-5), [6](https://packages.debian.org/sid/g++-6)}.
25
26There are no other external dependencies.
27
28
29## Links
30[Discussions group](https://www.facebook.com/groups/libfatal/) on [Facebook](https://code.facebook.com/)
31
32[Try it online](http://metashell.org/about/demo/index.html) using [Metashell](https://github.com/metashell/metashell).
33
34
35## Philosophy
36Fatal moves fast, therefore it uses the latest and greatest in C++ standards. It aims to adopt new standard features as soon as they're officially out, as long as they provide benefits like performance, productivity and usability improvements.
37
38Stable versions are tagged and can be found under the [list of releases](https://github.com/facebook/fatal/releases). Look out for breaking changes whenever a new release is made (see below) - they should be listed on the release notes.
39
40The [`master`](https://github.com/facebook/fatal/) branch is considered the development version of the library and experiences frequent updates. If you want the bleeding edge, that's the branch for you. Be advised, though, that it is under heavy development: breaking changes might be introduced without notice. They'll be tagged with the string `[break]` in the first line of the commit message.
41
42
43## Installation
44There's no need to install Fatal, as long as you add its base directory to the include directories list.
45
46For Clang and GCC, it suffices to either:
47- use the `-I path/to/fatal` flag
48- set the environment variable `CPLUS_INCLUDE_PATH=path/to/fatal`
49
50
51## Building Benchmarks and Unit Tests
52```sh
53$ clang++ -Wall -Werror -O2 -std=c++14 -I path/to/fatal \
54  -o path/to/output/binary path/to/test/or/benchmark.cpp \
55```
56or
57```sh
58$ g++ -Wall -Werror -O2 -std=c++14 -I path/to/fatal \
59  -o path/to/output/binary path/to/test/or/benchmark.cpp \
60```
61
62
63## Join the Fatal community
64- Website: https://github.com/facebook/fatal/
65- Facebook Group: https://www.facebook.com/groups/libfatal/
66- Talk at CppCon 2014: https://www.youtube.com/watch?v=0A9pYr8wevk
67
68See the CONTRIBUTING file for how to help out.
69
70
71## License
72Fatal is BSD-licensed. We also provide an additional patent grant.
73