Initial Course
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#include "dynamic_memory.hpp"
|
||||
|
||||
namespace pointers {
|
||||
|
||||
auto allocate_and_fill(std::size_t count, int value) -> int* { (void)count; (void)value; return nullptr; }
|
||||
void deallocate(int* ptr) { delete[] ptr; }
|
||||
auto clone_array(const int* source, std::size_t count) -> int* { (void)source; (void)count; return nullptr; }
|
||||
|
||||
} // namespace pointers
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "pointer_arithmetic.hpp"
|
||||
|
||||
namespace pointers {
|
||||
|
||||
auto pointer_distance(const int* begin, const int* end) -> std::size_t { (void)begin; (void)end; return 0; }
|
||||
auto find_pointer(const int* begin, const int* end, int target) -> const int* { (void)begin; (void)end; (void)target; return end; }
|
||||
void reverse_in_place(int* begin, int* end) { (void)begin; (void)end; }
|
||||
|
||||
} // namespace pointers
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "pointer_basics.hpp"
|
||||
|
||||
namespace pointers {
|
||||
|
||||
auto get_value(int* ptr) -> int { (void)ptr; return 0; }
|
||||
void set_value(int* ptr, int value) { (void)ptr; (void)value; }
|
||||
auto is_null(const int* ptr) -> bool { (void)ptr; return true; }
|
||||
void swap_via_pointers(int* a, int* b) { (void)a; (void)b; }
|
||||
|
||||
} // namespace pointers
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "references.hpp"
|
||||
|
||||
namespace pointers {
|
||||
|
||||
auto double_value(const int& value) -> int { (void)value; return 0; }
|
||||
void increment(int& value) { (void)value; }
|
||||
auto max_ref(const int& a, const int& b) -> const int& { (void)a; (void)b; return a; }
|
||||
auto sum_three(const int& a, const int& b, const int& c) -> int { (void)a; (void)b; (void)c; return 0; }
|
||||
|
||||
} // namespace pointers
|
||||
Reference in New Issue
Block a user