mirror of
https://github.com/xfarrow/lasd.git
synced 2025-06-05 21:49:14 +02:00
Library 4
added template
This commit is contained in:
90
librerie/exercise4/stack/lst/stacklst.hpp
Normal file
90
librerie/exercise4/stack/lst/stacklst.hpp
Normal file
@ -0,0 +1,90 @@
|
||||
|
||||
#ifndef STACKLST_HPP
|
||||
#define STACKLST_HPP
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../stack.hpp"
|
||||
#include "../../list/list.hpp"
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
namespace lasd {
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
template <typename Data>
|
||||
class StackLst { // Must extend Stack<Data> and List<Data>
|
||||
|
||||
private:
|
||||
|
||||
// ...
|
||||
|
||||
protected:
|
||||
|
||||
// using List<Data>::???;
|
||||
|
||||
// ...
|
||||
|
||||
public:
|
||||
|
||||
// Default constructor
|
||||
// StackLst() specifier;
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Specific constructor
|
||||
// StackLst(argument) specifiers; // A stack obtained from a LinearContainer
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Copy constructor
|
||||
// StackLst(argument);
|
||||
|
||||
// Move constructor
|
||||
// StackLst(argument);
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Destructor
|
||||
// ~StackLst() specifier;
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Copy assignment
|
||||
// type operator=(argument);
|
||||
|
||||
// Move assignment
|
||||
// type operator=(argument);
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Comparison operators
|
||||
// type operator==(argument) specifiers;
|
||||
// type operator!=(argument) specifiers;
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Specific member functions (inherited from Stack)
|
||||
|
||||
// type Push(argument) specifiers; // Override Stack member (copy of the value)
|
||||
// type Push(argument) specifiers; // Override Stack member (move of the value)
|
||||
// type Top() specifiers; // Override Stack member (must throw std::length_error when empty)
|
||||
// type Pop() specifiers; // Override Stack member (must throw std::length_error when empty)
|
||||
// type TopNPop() specifiers; // Override Stack member (must throw std::length_error when empty)
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Specific member functions (inherited from Container)
|
||||
|
||||
// type Clear() specifiers; // Override Container member
|
||||
|
||||
};
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
}
|
||||
|
||||
#include "stacklst.cpp"
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user