From 7a133ab2dc3c500aa1a5d92efb2052581fc54c9f Mon Sep 17 00:00:00 2001 From: surtur Date: Mon, 1 Nov 2021 09:23:22 +0100 Subject: [PATCH] namespace-wrap the generator function block * the purpose is to subdivide the global scope * use 'fortuna' as the top-level namespace * use 'generator' namespace for the generator functions * wrap the entire file after includes --- generator.cpp | 6 ++++++ generator.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/generator.cpp b/generator.cpp index bf1e914..593aebc 100644 --- a/generator.cpp +++ b/generator.cpp @@ -5,6 +5,9 @@ #include #include "generator.h" +namespace fortuna { +namespace generator { + using namespace std; struct G_state{ @@ -78,3 +81,6 @@ auto generate_random_data(G_state G, uint n) -> tuple { return {r, G}; }; +} // namespace generator +} // namespace fortuna + diff --git a/generator.h b/generator.h index 883708e..3732a57 100644 --- a/generator.h +++ b/generator.h @@ -5,6 +5,9 @@ #include #include +namespace fortuna { +namespace generator { + struct G_state; /* initializes generator */ @@ -21,4 +24,6 @@ auto generate_blocks(G_state G, int k_blocks) -> std::tuple std::tuple; +} //namespace generator +} //namespace fortuna #endif//FORTUNA_GENERATOR_H