File tree Expand file tree Collapse file tree 7 files changed +174
-351
lines changed Expand file tree Collapse file tree 7 files changed +174
-351
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ include( "${CMAKE_CURRENT_SOURCE_DIR}/../CompilerSettings.cmake" )
8
8
include ( "${CMAKE_CURRENT_SOURCE_DIR} /../SolutionTarget.cmake" )
9
9
10
10
# Create the user's executable.
11
- add_executable ( trymove "NVector.hpp" " trymove.cpp" )
11
+ add_executable ( trymove "trymove.cpp" )
12
12
13
13
# Create the "solution executable".
14
- add_executable ( trymove.sol EXCLUDE_FROM_ALL "solution/NVector.sol.hpp" "solution/ trymove.sol.cpp" )
14
+ add_executable ( trymove.sol EXCLUDE_FROM_ALL "solution/trymove.sol.cpp" )
15
15
add_dependencies ( solution trymove.sol )
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ solution: trymove.sol
4
4
clean :
5
5
rm -f * o trymove trymove.sol * ~ callgrind.out.*
6
6
7
- trymove : trymove.cpp NVector.hpp
8
- ${CXX} -g -std=c++11 -O0 -Wall -Wextra -L. -o $@ $<
7
+ trymove : trymove.cpp
8
+ ${CXX} -g -std=c++17 -O2 -Wall -Wextra -L. -o $@ $<
9
9
10
- trymove.sol : solution/trymove.sol.cpp solution/NVector.sol.hpp
11
- ${CXX} -g -std=c++11 -O0 -Wall -Wextra -L. -o $@ $<
10
+ trymove.sol : solution/trymove.sol.cpp
11
+ ${CXX} -g -std=c++17 -O2 -Wall -Wextra -L. -o $@ $<
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
-
2
1
## Prerequisites
3
-
4
- * be able to use simple templated code
2
+ - Copy and move constructors
3
+ - Copy and move assignment operators
5
4
6
5
## Instructions
7
6
8
- * look at the code and run it with callgrind
7
+ * look at the code and run it with callgrind or time it e.g. using ` /usr/bin/time ./trymove `
9
8
* understand how inefficient it is
10
- * implement move semantic the easy way in NVector
11
- * run with callgrind and see no improvement
12
9
* understand why and fix trymove.cpp
13
10
* see efficiency improvements
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments