#ifndef VISITORPRINT2_H
#define VISITORPRINT2_H

#include <visitor.h>

/*!
\brief Print functional object in simulated templated
 virtual functions pattern. */
template<typename T>
class visitorPrint2 : public Visitor
{
  T arg;
  visitorPrint2() { assert(false); }
public:

  /** Capture the type which is used to in the template part of
      the simulated virtual function. */
  visitorPrint2(T arg_) : arg(arg_) {}
  
  /** Execute templated virtual funtion print on data type ElementA. */
  void visit(ElementA & w) const { w.print2(arg); }
  /** Execute templated virtual funtion print on data type ElementB. */
  void visit(ElementB & w) const { w.print2(arg); }

};



#endif





