README.md revision 4e596761eb0ae42ff032c44c22dba9be5adc8733
1# GSL: Guidelines Support Library [![Build Status](https://travis-ci.org/Microsoft/GSL.svg?branch=master)](https://travis-ci.org/Microsoft/GSL)
2
3The Guidelines Support Library (GSL) contains functions and types that are suggested for use by the
4[C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines) maintained by the [Standard C++ Foundation](https://isocpp.org).
5This repo contains Microsoft's implementation of GSL.
6
7The library includes types like `array_view<>`, `string_view<>`, `owner<>` and others.
8
9The entire implementation is provided inline in the headers under the [include](./include) directory.
10
11While some types have been broken out into their own headers (e.g. [include/array_view.h](./include/array_view.h)),
12it is simplest to just include [gsl.h](./include/gsl.h) and gain access to the entire library.
13
14> NOTE: We encourage contributions that improve or refine any of the types in this library as well as ports to
15other platforms. Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for more information about contributing.
16
17# Quick Start
18## Supported Platforms
19The test suite that exercises GSL has been built and passes successfully on the following platforms:
20
21* Windows using Visual Studio 2013
22* Windows using Visual Studio 2015
23* Windows using Clang/LLVM 3.6
24* Windows using GCC 5.1
25* GNU/Linux using Clang/LLVM 3.6
26* GNU/Linux using GCC 5.1
27* OS X Yosemite using Xcode with AppleClang 7.0.0.7000072
28* OS X Yosemite using GCC-5.2.0
29* FreeBSD 10.x with Clang/LLVM 3.6
30
31> If you successfully port GSL to another platform, we would love to hear from you. Please submit an issue to let us know. Also please consider
32contributing any changes that were necessary back to this project to benefit the wider community.
33
34## Building the tests
35To build the tests, you will require the following:
36
37* [CMake](http://cmake.org), version 2.8.7 or later to be installed and in your PATH.
38* [UnitTest-cpp](https://github.com/Microsoft/unittest-cpp), to be cloned under the [tests/unittest-cpp](./tests/unittest-cpp) directory
39of your GSL source.
40
41These steps assume the source code of this repository has been cloned into a directory named `c:\GSL`.
42
431. Create a directory to contain the build outputs for a particular architecture (we name it c:\GSL\vs14-x86 in this example).
44
45        cd GSL
46        md build-x86
47        cd build-x86
48
492. Configure CMake to use the compiler of your choice (you can see a list by running `cmake --help`).
50
51        cmake -G "Visual Studio 14 2015" c:\GSL
52
533. Build the test suite (in this case, in the Debug configuration, Release is another good choice).    
54
55        cmake --build . --config Debug
56
574. Run the test suite.    
58
59        ctest -C Debug
60
61All tests should pass - indicating your platform is fully supported and you are ready to use the GSL types!
62
63## Using the libraries
64As the types are entirely implemented inline in headers, there are no linking requirements.
65
66Just place the contents of the [include](./include) directory within your source tree so it is available
67to your compiler, then include the appropriate headers in your program, and away you go!
68