Skip to content

Commit 01ac878

Browse files
committed
update clang test to chapter 10-13
1 parent 2a6fe31 commit 01ac878

20 files changed

+62
-26
lines changed

CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ add_subdirectory(chapter-2)
77
add_subdirectory(chapter-7)
88
add_subdirectory(chapter-8)
99
add_subdirectory(chapter-9)
10-
# add_subdirectory(chapter-10)
10+
add_subdirectory(chapter-10)
11+
add_subdirectory(chapter-11)
12+
add_subdirectory(chapter-12)
13+
add_subdirectory(chapter-13)

chapter-10/10-1/person.cppm

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ export namespace HR
4040
m_FirstUnitOfName = c;
4141
}
4242

43-
virtual [[nodiscard]] bool operator==(const Person &rhs) const
43+
[[nodiscard]] virtual bool operator==(const Person &rhs) const
4444
{
4545
return (m_FirstUnitOfName == rhs.getFirstUnitOfName() && m_FirstName == rhs.getFirstName() && m_LastName == rhs.getLastName());
4646
};
47-
virtual [[nodiscard]] std::strong_ordering operator<=>(const Person &rhs) const
47+
[[nodiscard]] virtual std::strong_ordering operator<=>(const Person &rhs) const
4848
{
4949
if (m_FirstUnitOfName != rhs.getFirstUnitOfName())
5050
{

chapter-10/10-2/person.cppm

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ export namespace HR
4040
m_FirstUnitOfName = c;
4141
}
4242

43-
virtual [[nodiscard]] bool operator==(const Person &rhs) const
43+
[[nodiscard]] virtual bool operator==(const Person &rhs) const
4444
{
4545
return (getFirstUnitOfName() == rhs.getFirstUnitOfName() && getFirstName() == rhs.getFirstName() && getLastName() == rhs.getLastName());
4646
};
47-
virtual [[nodiscard]] std::strong_ordering operator<=>(const Person &rhs) const
47+
[[nodiscard]] virtual std::strong_ordering operator<=>(const Person &rhs) const
4848
{
4949
if (getFirstUnitOfName() != rhs.getFirstUnitOfName())
5050
{

chapter-10/10-3/person.cppm

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ export namespace HR
4040
m_FirstUnitOfName = c;
4141
}
4242

43-
virtual [[nodiscard]] bool operator==(const Person &rhs) const
43+
[[nodiscard]] virtual bool operator==(const Person &rhs) const
4444
{
4545
return (getFirstUnitOfName() == rhs.getFirstUnitOfName() && getFirstName() == rhs.getFirstName() && getLastName() == rhs.getLastName());
4646
};
47-
virtual [[nodiscard]] std::strong_ordering operator<=>(const Person &rhs) const
47+
[[nodiscard]] virtual std::strong_ordering operator<=>(const Person &rhs) const
4848
{
4949
if (getFirstUnitOfName() != rhs.getFirstUnitOfName())
5050
{

chapter-10/10-4/person.cppm

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ export namespace HR
4040
m_FirstUnitOfName = c;
4141
}
4242

43-
virtual [[nodiscard]] bool operator==(const Person &rhs) const
43+
[[nodiscard]] virtual bool operator==(const Person &rhs) const
4444
{
4545
return (getFirstUnitOfName() == rhs.getFirstUnitOfName() && getFirstName() == rhs.getFirstName() && getLastName() == rhs.getLastName());
4646
};
47-
virtual [[nodiscard]] std::strong_ordering operator<=>(const Person &rhs) const
47+
[[nodiscard]] virtual std::strong_ordering operator<=>(const Person &rhs) const
4848
{
4949
if (getFirstUnitOfName() != rhs.getFirstUnitOfName())
5050
{

chapter-11/11-1/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ include("../../module.cmake")
77
add_executable(11-1)
88
target_sources(11-1
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
Simulator.cppm
1314
)

chapter-11/11-2/CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ include("../../module.cmake")
77
add_executable(11-2)
88
target_sources(11-2
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
Simulator.cppm
13-
PRIVATE
14+
PUBLIC
1415
Simulator.cpp
1516
)

chapter-11/11-3/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ include("../../module.cmake")
77
add_executable(11-3)
88
target_sources(11-3
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
Simulator.cppm
13-
PRIVATE
1414
Simulator.bike.cppm
1515
Simulator.car.cppm
1616
)

chapter-11/11-4/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ include("../../module.cmake")
77
add_executable(11-4)
88
target_sources(11-4
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
Simulator.cppm
13-
PRIVATE
1414
Simulator.bike.cppm
1515
Simulator.car.cppm
1616
Simulator.internals.cppm

chapter-11/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.25)
2+
3+
project(chapter-11)
4+
5+
add_subdirectory(11-1)
6+
add_subdirectory(11-2)
7+
add_subdirectory(11-3)
8+
add_subdirectory(11-4)

chapter-12/12-1/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ include("../../module.cmake")
77
add_executable(12-1)
88
target_sources(12-1
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
KeyValuePair.cppm
1314
)

chapter-12/12-2/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ include("../../module.cmake")
77
add_executable(12-2)
88
target_sources(12-2
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
KeyValuePair.cppm
13-
PRIVATE
1414
KeyValuePair.main.cppm
1515
KeyValuePair.string.cppm
1616
)

chapter-12/12-3/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ include("../../module.cmake")
77
add_executable(12-3)
88
target_sources(12-3
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
KeyValuePair.cppm
1314
)

chapter-12/12-4/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ include("../../module.cmake")
77
add_executable(12-4)
88
target_sources(12-4
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
concat.cppm
1314
)

chapter-12/12-5/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ include("../../module.cmake")
77
add_executable(12-5)
88
target_sources(12-5
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
concat.cppm
1314
)

chapter-12/12-6/CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ include("../../module.cmake")
77
add_executable(12-6)
88
target_sources(12-6
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
FindTemplate.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
SpreadsheetCell.cppm
13-
PRIVATE
14+
PUBLIC
1415
SpreadsheetCell.cpp
1516
)

chapter-12/CMakeLists.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.25)
2+
3+
project(chapter-12)
4+
5+
add_subdirectory(12-1)
6+
add_subdirectory(12-2)
7+
add_subdirectory(12-3)
8+
add_subdirectory(12-4)
9+
add_subdirectory(12-5)
10+
# add_subdirectory(12-6) from_char not implemented in libc++

chapter-13/13-1/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ include("../../module.cmake")
77
add_executable(13-1)
88
target_sources(13-1
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
Person.cppm
1314
)

chapter-13/13-2/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ include("../../module.cmake")
77
add_executable(13-2)
88
target_sources(13-2
99
PUBLIC
10-
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1110
main.cpp
11+
PUBLIC
12+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
1213
Person.cppm
1314
)

chapter-13/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.25)
2+
3+
project(chapter-13)
4+
5+
add_subdirectory(13-1)
6+
add_subdirectory(13-2)

0 commit comments

Comments
 (0)