Page MenuHomec4science

aka_empty_iterator.hh
No OneTemporary

File Metadata

Created
Sat, Oct 19, 15:44

aka_empty_iterator.hh

/**
* @file aka_concatenate_iterator.hh
*
* @author Nicolas Richart
*
* @date creation jeu déc 12 2019
*
* @brief implementation of arange
*
*
* Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* akantu-iterators is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* akantu-iterators is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with akantu-iterators. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#ifndef AKA_EMPTY_ITERATOR_H
#define AKA_EMPTY_ITERATOR_H
#ifndef AKANTU_ITERATORS_NAMESPACE
#define AKANTU_ITERATORS_NAMESPACE akantu
#endif
namespace AKANTU_ITERATORS_NAMESPACE {
namespace iterators {
class empty_iterator {
public:
decltype(auto) operator++() { return *this; }
decltype(auto) operator++(int) { return *this; }
decltype(auto) operator==() { return false; }
decltype(auto) operator!=() { return false; }
};
} // namespace iterators
class EmptyContainer {
public:
decltype(auto) begin() { return iterators::empty_iterator(); }
decltype(auto) end() { return iterators::empty_iterator(); }
};
} // namespace AKANTU_ITERATORS_NAMESPACE
#endif // AKA_EMPTY_ITERATOR_H

Event Timeline