diff enigma/machine.cpp @ 14:919b7a0d1802

Ditched shared_ptr.
author Brian Neal <bgneal@gmail.com>
date Mon, 02 Jul 2012 19:23:49 -0500
parents b9d124a15926
children
line wrap: on
line diff
--- a/enigma/machine.cpp	Mon Jul 02 19:14:36 2012 -0500
+++ b/enigma/machine.cpp	Mon Jul 02 19:23:49 2012 -0500
@@ -16,12 +16,12 @@
 
 enigma_machine::enigma_machine(
       const rotor_vector& rv,
-      std::shared_ptr<rotor> reflector,
+      const rotor& reflector,
       const plugboard& pb)
  : rotors(),
    pb(pb)
 {
-   rotors.push_back(*reflector);
+   rotors.push_back(reflector);
    for (const auto& r : rv)
    {
       rotors.push_back(*r);
@@ -33,11 +33,11 @@
 
 enigma_machine::enigma_machine(
       const rotor_vector& rv,
-      std::shared_ptr<rotor> reflector)
+      const rotor& reflector)
  : rotors(),
    pb()
 {
-   rotors.push_back(*reflector);
+   rotors.push_back(reflector);
    for (const auto& r : rv)
    {
       rotors.push_back(*r);