Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and use GSL in C++

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces how to install and use GSL in C++. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

Gsl::index I = 0position while (I

< v.size()) { // ... do something with v[i] ...} 其中引人注目的一个地方是:gsl::index。关于这个gsl,如果去网上搜,可能找到的是这样的结果:

It's kind of like it, but it's not. Gsl here refers to Guidelines support library, a support library specially prepared by Microsoft for the core guidelines of C++. Once again sigh: the master is the master, Microsoft will follow.

Install GSL

We can download and install GSL by following these steps.

First download the file from the following link: https://github.com/Microsoft/GSL. Here the author uses Git Clone.

Open the property page of the current project and go to the VC++ directory option.

Click the down arrow to the right of [include Catalog] and select "Edit" to open the editing screen of the included directory.

Add the gsl\ include and gsl\ include\ gsl directories as shown. GSL is just a set of header files, and the installation process is all over.

Use GSL

After the above preparation, you can write and debug the following program: # include#include#include#includeint main () {std::vector v {1rec 2meme 3meme 4pm 5je 6}; gsl::index I = 0; while (I < v.size ()) {std::cout

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report