From 597f46d8eea2d1fda94b1b94cfea1ae38bf02855 Mon Sep 17 00:00:00 2001 From: felpsisonfire Date: Mon, 1 Oct 2018 14:46:18 +0000 Subject: [PATCH] good pratices --- src/main.cpp | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 130d6d8..33c7204 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,19 +10,21 @@ //!< \author Felipe Ramos and Max William int main( int argc, char **argv ){ + try { - try{ - sc::vector simpleVector = { 0, 2, 4, 6, 8, 10 }; - std::cout << "> Print simpleVector" << std::endl; - std::cout << "[ "; - for( auto &i : simpleVector ){ - std::cout << i << " "; - } - std::cout << "]\n"; - } catch( ... ){ - std::cout << "Some error had happened!" << std::endl; + sc::vector simpleVector = { 0, 2, 4, 6, 8, 10 }; + std::cout << "> Print simpleVector" << std::endl; + std::cout << "[ "; + for( auto &i : simpleVector ){ + std::cout << i << " "; } + std::cout << "]\n"; } + catch( ... ) + { + std::cout << "Some error had happened!" << std::endl; + } + SLPool p(300); { int * some_int = new(p) int; @@ -60,16 +62,16 @@ int main( int argc, char **argv ){ int a,b,c; }; - teste* testezin = new (p) teste; - testezin->a = 3; - testezin->b = 4; - testezin->c = 5; + teste* just_test = new (p) teste; + just_test->a = 3; + just_test->b = 4; + just_test->c = 5; - assert(testezin->a == 3); - assert(testezin->b == 4); - assert(testezin->c == 5); + assert(just_test->a == 3); + assert(just_test->b == 4); + assert(just_test->c == 5); - delete testezin; + delete just_test; } {