diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-11-12 15:46:07 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-11-12 15:46:07 +0100 |
| commit | b8e39b947890e74d82530e25ad9d02668aae1f0c (patch) | |
| tree | f59acfdecb0711137c200a4c5acb854e351f9cf9 /cpp04/ex00/main.cpp | |
| parent | 96dcf214a8c40529b251ea31ef037868583dd1da (diff) | |
| download | piscine_cpp-b8e39b947890e74d82530e25ad9d02668aae1f0c.tar.gz piscine_cpp-b8e39b947890e74d82530e25ad9d02668aae1f0c.tar.bz2 piscine_cpp-b8e39b947890e74d82530e25ad9d02668aae1f0c.zip | |
Reformating cpp04 classes
Diffstat (limited to 'cpp04/ex00/main.cpp')
| -rw-r--r-- | cpp04/ex00/main.cpp | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/cpp04/ex00/main.cpp b/cpp04/ex00/main.cpp index 9c17e99..8bf96bf 100644 --- a/cpp04/ex00/main.cpp +++ b/cpp04/ex00/main.cpp @@ -6,25 +6,64 @@ /* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/13 20:47:34 by charles #+# #+# */ -/* Updated: 2020/04/13 20:57:19 by charles ### ########.fr */ +/* Updated: 2020/11/12 13:11:26 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ +#include <iostream> #include "Sorcerer.hpp" #include "Victim.hpp" #include "Peon.hpp" int main() { - Sorcerer robert("Robert", "the Magnificent"); + { + std::cout << "==================== SUBJECT MAIN =====================" << std::endl; + Sorcerer robert("Robert", "the Magnificent"); + Victim jim("Jimmy"); + Peon joe("Joe"); + std::cout << robert << jim << joe; + robert.polymorph(jim); + robert.polymorph(joe); + } - Victim jim("Jimmy"); - Peon joe("Joe"); + std::cout << std::endl; - std::cout << robert << jim << joe; + { + std::cout << "==================== SORCERER =====================" << std::endl; + Sorcerer s("DidierLeSorcier", "The cunt"); + Sorcerer s_copied(s); + Sorcerer s_assigned("foo", "yep clock"); + s_assigned = s; + std::cout << "Copied: " << s_copied; + std::cout << "Assigned: " << s_assigned; + } - robert.polymorph(jim); - robert.polymorph(joe); + std::cout << std::endl; + + { + std::cout << "==================== VICTIM =====================" << std::endl; + Victim v("Victoire"); + Victim v_copied(v); + Victim v_assigned("bar"); + v_assigned = v; + std::cout << "Copied: " << v_copied; + std::cout << "Assigned: " << v_assigned; + v.getPolymorphed(); + } + + std::cout << std::endl; + + { + std::cout << "==================== PEON =====================" << std::endl; + Peon p("Victoire"); + Peon p_copied(p); + Peon p_assigned("baz"); + p_assigned = p; + std::cout << "Copied: " << p_copied; + std::cout << "Assigned: " << p_assigned; + p.getPolymorphed(); + } return 0; } |
