David Blume's GitList
Repositories
testcode.git
Code
Commits
Branches
Tags
Search
Tree:
56e9725
Branches
Tags
c++11
main
start
testcode.git
product
main_helper.cpp
Add .clang-format
dblume
commited
56e9725
at 2023-08-12 23:24:26
main_helper.cpp
Blame
History
Raw
#include <iostream> #include <string> #include <vector> #include "main_helper.hpp" using namespace std; int read(std::string const& directory, const std::vector<unsigned char>& secret) { // directory = directory + "aaa"; return directory.length(); } int main_helper_fn() { cout << "The function " << __PRETTY_FUNCTION__ << " was called." << endl; string my_string("Hello"); vector<unsigned char> secret; cout << "The length of hello is " << read(my_string, secret) << endl; return 0; } #if __cplusplus == 201402L class MyClass::Impl { public: void f() { cout << "The function " << __PRETTY_FUNCTION__ << " was called." << endl; }; }; MyClass::MyClass() : pimpl{std::make_unique<Impl>()} {} // See http://www.cppsamples.com/common-tasks/pimpl.html MyClass::~MyClass() = default; void MyClass::f() { pimpl->f(); } #endif