README.md revision 2c8886bdfb532702484ee0c8d28c5b483c34fb6f
1# GSL: Guidelines Support Library
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
30> 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 
31contributing any changes that were necessary back to this project to benefit the wider community. 
32
33## Building the tests
34To build the tests, you will require the following:
35
36* [CMake](http://cmake.org), version 3.3 or later to be installed and in your PATH.
37* [UnitTest-cpp](https://github.com/Microsoft/unittest-cpp), to be cloned under the [tests/unittest-cpp](./tests/unittest-cpp) directory
38of your GSL source.
39
40These steps assume the source code of this repository has been cloned into a directory named `c:\GSL`.
41
421. Create a directory to contain the build outputs for a particular architecture (we name it c:\GSL\vs14-x86 in this example).
43
44        cd GSL
45        md build-x86
46        cd build-x86
47
482. Configure CMake to use the compiler of your choice (you can see a list by running `cmake --help`).
49    
50        cmake -G "Visual Studio 14 2015" c:\GSL
51    
523. Build the test suite (in this case, in the Debug configuration, Release is another good choice).    
53
54        cmake --build . --config Debug
55 
564. Run the test suite.    
57
58        ctest -C Debug
59
60All tests should pass - indicating your platform is fully supported and you are ready to use the GSL types!
61
62## Using the libraries
63As the types are entirely implemented inline in headers, there are no linking requirements.
64
65Just place the contents of the [include](./include) directory within your source tree so it is available
66to your compiler, then include the appropriate headers in your program, and away you go!
67