Hacker News new | past | comments | ask | show | jobs | submit login

I've only have a pretty basic understanding of how it works, but I thought the checks didn't rely on the compiler. They're special templates that fail when their conditions aren't met

And when I say it didn't take off - I mean that I haven't come across a single large project that has take up using the GSL. Hope I'm wrong - maybe I just haven't looked in the right place?




No, GSL is a kind of stop-gap solution, until standard catches on.

For example std::string_view and ongoing design on std::array_view are based on gsl::span. The gsl::byte is also no longer needed on C++17 thanks to std::byte as yet another example.

The GSL asserts are there until code contracts[0] get into the standard.

The magical types like gsl::owner allow clang-tidy and VC++ checkers to apply a Rust-like memory tracking usage.

Kate Gregory did a presentation at CppCon 2017.

"10 Core Guidelines You Need to Start Using Now"

https://www.youtube.com/watch?v=XkDEzfpdcSg

As for not taking off, being initially a Microsoft proposal, it is surely used by Office and Windows teams, specially given they already use SDL (Security Definition Language) macros as well.

[0] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p054...




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: