This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#ifndef TMPCONTAINER_HEADER | |
#define TMPCONTAINER_HEADER | |
#include <vector> | |
#include <memory> | |
template <typename type> | |
class Vector { | |
public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#ifndef QUOTE_H | |
#define QUOTE_H | |
#include <iostream> /// std::cout, std::ostream | |
#include <utility> /// std::pair, std::move | |
class Quote { | |
public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#ifndef CLASS_HEADER | |
#define CLASS_HEADER | |
#include <vector> | |
#include <iostream> | |
struct skill_info { | |
skill_info () = default; | |
skill_info (const std::string &n, const std::string &des, const int &lvl, const double &cd) : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "String.h" | |
/// implementation section | |
namespace Custom { | |
std::allocator <char> String::a_mem; | |
String::String (const char *c_char) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
int main () | |
{ | |
const size_t sz = 2; | |
char c_str[] = {'2', '3'}; | |
std::vector <char> c; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <list> | |
int main () | |
{ | |
std::list <int> v1 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; | |
auto curr = v1.begin(); | |
while (curr != v1.end()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <forward_list> | |
int main () | |
{ | |
std::forward_list <int> v1 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; | |
auto curr = v1.begin(); | |
auto prev = v1.before_begin (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <forward_list> | |
void add_str (std::forward_list <std::string> flst, std::string str1 = "", std::string str2 = "") { | |
if (!str1.empty()) { | |
flst.insert_after (flst.before_begin(), str2); | |
flst.insert_after (flst.before_begin(), str1); | |
} else { | |
flst.insert_after (flst.before_begin(), str2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <list> | |
#include <vector> | |
int main () | |
{ | |
int ia[11] = {0, 1, 1, 2, 3, 5, 8, 13, 21, 55, 89}; /// declare and define ia as int array that has a size of 11 (built in array) | |
std::list <int> lst (std::begin(ia), std::end(ia)); /// initialize a value range from one past to the end of the array | |
std::vector <int> v1 (std::begin(ia), std::end(ia)); /// same |