microsoft/GSL
View on GitHub ↗ ★ 6,733 C++
Guidelines Support Library
27 mentions on Hacker News by 22 people: 1 story, 26 comments · first 2015-11-14 · latest 2026-08-03
20082026
-
…for GSL I'm a bit more skeptical that such support would extend to XCode, GCC, and Clang. [0]: https://github.com/microsoft/GSL/tree/99a29ce797c8337b8923f2...
comment by aw1621107 · 2026-08-03 · in C++ float-to-int conversion can be undefined behavior -
…that they're going to look into fixing the UB. Sutter may have just been stating an assumption. https://github.com/microsoft/GSL/issues/786#issuecomment-513... > I'll raise this issue in the next internal GSL sync. I'd agree with y'all…
comment by wavemode · 2026-08-03 · in C++ float-to-int conversion can be undefined behavior -
The C++ core guideline support library has it. https://github.com/microsoft/GSL/blob/main/docs/headers.md#u... What do you mean by move-out unique_ptr? That the not_null ptr type would ne null after it's been moved? In that case that's…
comment by cenamus · 2026-07-24 · in The PImpl idiom and the C++26 std:indirect type -
…Guidelines Support Library, GSL). Which seems to be this (at least Microsoft's implementation): https://github.com/microsoft/GSL And I'm left wondering, is this just how C++ is? Can't the language provide tooling for me to better adhere to…
comment by modernerd · 2025-02-05 · in 21st Century C++ -
…somehow so we don't end up with multiple syntaxes in C++? https://reviews.llvm.org/D64448 https://github.com/microsoft/GSL/blob/main/docs/headers.md#g...
comment by dataflow · 2024-02-20 · in Cake – C23 and Beyond (2023) -
…it introduces a similar disruption like you might find from a brand new programming language. [1] https://github.com/microsoft/GSL
comment by wyldfire · 2023-02-14 · in C++23 “Pandemic Edition” is complete -
…be a gentler way to get some of the benefits of Rust. But it comes with a similarly higher bar. [1] https://github.com/microsoft/GSL
comment by wyldfire · 2022-12-03 · in Using Rust at a startup: A cautionary tale -
That's correct. Also see https://github.com/microsoft/GSL , which is a header-only C++ library that implements the Guidelines Support Library as specified by ISO C++. It's extremely useful (especially to get std::span<T> if you don't have…
comment by qalmakka · 2021-06-26 · in Goodbye C++, Hello C -
…https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines GSL (Core Guidelines Support Library): https://github.com/Microsoft/GSL
comment by dgellow · 2021-04-03 · in The Sad Truth About C++ Copy Elision -
…comes with the class "final_action" and the function "finally()". Check the implementation here: https://github.com/microsoft/GSL/blob/master/include/gsl/gsl... . Example from https://docs.microsoft.com/en-us/cpp/code-quality/c26448?vie...…
comment by dgellow · 2020-10-01 · in Defer Reference Implementation for C -
C++ has it though, https://github.com/microsoft/GSL/blob/master/include/gsl/spa...
comment by pjmlp · 2020-09-29 · in Zig's New Relationship with LLVM -
There's also the guideline support library (GSL) -- is anyone using it? https://github.com/Microsoft/GSL Stroustrup talk from 2016: https://www.youtube.com/watch?v=JtMPGwA3MzQ
comment by Tempest1981 · 2020-05-24 · in Chromium project finds that 70% of security defects are memory safety problems -
…final_action<F>(std::forward<F>(f)); } Usage: auto deferred = finally([&]{ /* deferred stuff */ }); https://github.com/microsoft/GSL/blob/master/include/gsl/gsl...
comment by usefulcat · 2020-03-19 · in A Defer Statement for C -
…= delete; ~final_act() noexcept { if (invoke_) f_(); } private: F f_; bool invoke_; }; Source: https://github.com/microsoft/GSL/blob/ebe7ebfd855a95eb937831...
comment by dgellow · 2019-12-20 · in Show HN: A simple garbage collector for C -
…ocpp/CppCoreGuidelines/blob/master/CppC... The only implementation so far seems to be from Microsoft: https://github.com/Microsoft/GSL/blob/master/include/gsl/gsl...
comment by nuxi · 2018-03-09 · in C++ Core Guidelines -
…remain interested in C++. [1] shameless plug: https://github.com/duneroadrunner/SaferCPlusPlus [2] https://github.com/Microsoft/GSL/blob/1c95f9436eae69c9b93159... [3] https://github.com/duneroadrunner/SaferCPlusPlus/blob/278b40...
comment by duneroadrunner · 2017-11-26 · in Carp, a compiled Lisp with type inference and a borrow checker -
That's what the GSL was supposed to be https://github.com/Microsoft/GSL It seemed really cool. All compile time checks. I have no idea why it didn't take off
comment by geokon · 2017-11-26 · in Carp, a compiled Lisp with type inference and a borrow checker -
https://github.com/Microsoft/GSL is an attempt at something like this. The Core Guidelines have been in development for a long time now; and they do only catch a subset of issues. I'm all in favor of making languages safer overall though!
comment by steveklabnik · 2017-09-12 · in Curl’s backdoor threat -
not_null style classes might be what you're after, e.g. https://github.com/Microsoft/GSL/blob/master/include/gsl/gsl... . Whan trying to store nullptr in it at runtime that will result in an exception or abort or whatever it's implemented…
comment by stinos · 2017-05-26 · in Value_ptr – The Missing C++ Smart-pointer -
…here had a chance to try it out? https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC... https://github.com/Microsoft/GSL https://msdn.microsoft.com/en-us/library/mt762841.aspx https://blogs.msdn.microsoft.com/vcblog/2016/10/12/cppc…
comment by corysama · 2017-03-28 · in It’s time for a memory safety intervention -
…support of the the CPP Core Guidelines). [0] https://github.com/isocpp/CppCoreGuidelines [1] https://github.com/microsoft/gsl/
comment by hermitdev · 2017-03-22 · in Software Engineering Institute Makes CERT C++ Coding Standard Freely Available -
…for the last couple of years. https://blogs.msdn.microsoft.com/vcblog/2015/12/03/c-core-gu... https://github.com/Microsoft/GSL https://www.youtube.com/watch?v=JfmTagWcqoE
comment by youdontknowtho · 2017-01-03 · in Rust is Software's Salvation -
…"C++ Core Guidelines", and "GSL". https://isocpp.org/blog/2015/09/bjarne-stroustrup-announces-... https://github.com/Microsoft/GSL I watched his talk -- wondering if anyone is using it. https://www.youtube.com/watch?v=1OEu9C51K2A Using GSL…
comment by Tempest1981 · 2016-12-28 · in Rust vs C Pitfalls -
…know what happened with this initiative? [1] https://www.youtube.com/watch?v=1OEu9C51K2A [2] https://github.com/Microsoft/GSL
comment by MichaelMoser123 · 2016-10-09 · in Type-Safe Unions in C++ and Rust -
▲ 2
Microsoft's Implementation of GSL: Guideline Support Librarystory by hitr · 2016-09-16 · 0 comments
-
here is the tool https://github.com/Microsoft/GSL Introduced in this year's cppcon https://channel9.msdn.com/Events/CPP/CppCon-2015/Writing-Goo...
comment by something123 · 2015-11-14 · in Breaking all the Eggs in C++ -
…just a nice literary exercise The static checker is found here (obviously still under development) https://github.com/Microsoft/GSL
comment by something123 · 2015-11-14 · in Breaking all the Eggs in C++