ms-gsl/4.0.0

Microsoft's implementation of the Guidelines Support Library
Recipe info
2023-11-20

Available packages
Header Only

Install
Add the following line to your conanfile.txt:
[requires]
ms-gsl/4.0.0

Using ms-gsl

Note

If you are new with Conan, we recommend to read the section how to consume packages.

If you need additional assistance, please ask a question in the Conan Center Index repository.

Simplest use case consuming this recipe and assuming CMake as your local build tool:

[requires]
ms-gsl/4.0.0
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
from conan import ConanFile
from conan.tools.cmake import cmake_layout


class ExampleRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"

    def requirements(self):
        self.requires("ms-gsl/4.0.0")

    def layout(self):
        cmake_layout(self)

Now, you can run this Conan command to locally install (and build if necessary) this recipe and its dependencies (if any):

$ conan install conanfile.txt --build=missing

Useful information to take into account to consume this library:


These are the main declared targets:

  • CMake package name(s): Microsoft.GSL
  • CMake target name(s): Microsoft.GSL::GSL
  • _ms-gsl => Microsoft.GSL::GSL
    
  • pkg-config file name(s): ms-gsl.pc
  • _ms-gsl => ms-gsl-_ms-gsl.pc
    

A simple use case using the CMake file name and the global target:

# ...
find_package(Microsoft.GSL REQUIRED)
# ...
target_link_libraries(YOUR_TARGET Microsoft.GSL::GSL)

These are all the available headers. Some of these ones might be non-public; make sure of it by visiting the ms-gsl homepage listed above:

#include "CMakeLists.txt"
#include "gsl/algorithm"
#include "gsl/assert"
#include "gsl/byte"
#include "gsl/gsl"
#include "gsl/gsl_algorithm"
#include "gsl/gsl_assert"
#include "gsl/gsl_byte"
#include "gsl/gsl_narrow"
#include "gsl/gsl_util"
#include "gsl/narrow"
#include "gsl/pointers"
#include "gsl/span"
#include "gsl/span_ext"
#include "gsl/string_span"
#include "gsl/util"