Skip to content

Commit 2624ff5

Browse files
committed
Tidy up for VS2022
1 parent c5e1268 commit 2624ff5

11 files changed

+14
-11
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ Complete, working programs from the C++ tutorial hosted at:
44

55
https://learnmoderncpp.com/course-details/
66

7-
## Usage
7+
## Contents
88

9-
The "headers" subdirectory contains C++ programs with legacy header `#includes`, whilst the "modules" subdirectory contains the same programs but using the `import` keyword instead. See https://learnmoderncpp.com/2020/09/05/where-are-c-modules/ for more details about C++ compilers which have support for modules.
9+
The "headers" subdirectory contains C++ programs with legacy header `#includes`, whilst the "modules" subdirectory contains the same programs using the `import` keyword instead. See https://learnmoderncpp.com/2020/09/05/where-are-c-modules/ for more details about C++ compilers which have support for modules.
1010

1111
## Compiling under Windows
1212

13-
All programs compile successfully under Windows with Visual Studio 2019 (v16.8 or later).
13+
All programs compile successfully under Windows with Visual Studio 2022 (v17.x or later).
1414

15-
The supplied batch scripts `build-vs2019-headers.bat` and
16-
`build-vs2019-modules.bat` can be used to compile all of the programs within a Visual Studio command prompt, simply run:
15+
The supplied batch scripts `build-vs2022-headers.bat` and
16+
`build-vs2022-modules.bat` can be used to compile all of the programs within a Visual Studio command prompt, simply run:
1717

18-
```C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat```
18+
```C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat```
1919

2020
or similar in a command window, or create a desktop link, and then run either of the build scripts.
2121

headers/03-calc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 03-calc.cpp : simple calculator with four funnctions
1+
// 03-calc.cpp : simple calculator with four functions
22

33
#include <iostream>
44
using namespace std;

headers/07-find.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <string>
66
#include <vector>
77
#include <set>
8+
#include <iterator>
89
using namespace std;
910

1011
int main() {

headers/07-set.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <string>
55
#include <set>
66
#include <algorithm>
7+
#include <iterator>
78
using namespace std;
89

910
int main() {

headers/07-vector.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <iostream>
44
#include <vector>
55
#include <algorithm>
6+
#include <iterator>
67
using namespace std;
78

89
int main() {

headers/build-clang-headers.sh

100644100755
File mode changed.

headers/build-gcc-headers.sh

100644100755
File mode changed.

headers/build-vs2022-headers.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22
REM This script will compile all files with .cpp extension in current directory
3-
REM Visual Studio 2019 (16.8) header file version
3+
REM Visual Studio 2022 (17.x) header file version
44

55
set failures=0
66
for %%f in (*.cpp) do echo %%f... && cl /std:c++latest /EHsc %%f >nul 2>nul || echo Failed to compile %%f && set /A failures=failures+1

modules/03-calc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 03-calc.cpp : simple calculator with four funnctions
1+
// 03-calc.cpp : simple calculator with four functions
22

33
import std.core;
44
using namespace std;

modules/build-clang-modules.sh

100644100755
File mode changed.

modules/build-vs2022-modules.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22
REM This script will compile all files with .cpp extension in current directory
3-
REM Visual Studio 2019 (16.8) C++ modules version
3+
REM Visual Studio 2022 (17.x) C++ modules version
44

55
set failures=0
6-
for %%f in (*.cpp) do echo %%f... && cl /std:c++latest /EHsc /experimental:module /MD /DEOF=-1 %%f >nul 2>nul || echo Failed to compile %%f && set /A failures=failures+1
6+
for %%f in (*.cpp) do echo %%f... && cl /std:c++latest /EHsc /experimental:module /MD %%f >nul 2>nul || echo Failed to compile %%f && set /A failures=failures+1
77
echo A total of %failures% files failed to compile.

0 commit comments

Comments
 (0)