diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 585472f7ab1d175b15b08195308a82de09892198..7618ba02ec1d1a0db4da425c27a8c9a08b343a94 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -33,6 +33,7 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/import-default-paths.h # Headers list. SET(${PROJECT_NAME}_HEADERS fwd.hh +null-ptr.hh contiifstream.h debug.h diff --git a/include/dynamic-graph/null-ptr.hh b/include/dynamic-graph/null-ptr.hh new file mode 100644 index 0000000000000000000000000000000000000000..2842e61d7c867f65f54b33aa663a4938e6d2d59d --- /dev/null +++ b/include/dynamic-graph/null-ptr.hh @@ -0,0 +1,41 @@ +// Copyright 2010, Thomas Moulard, JRL, CNRS/AIST +// +// This file is part of dynamic-graph. +// dynamic-graph 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. +// +// dynamic-graph 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 +// General Lesser Public License for more details. You should have +// received a copy of the GNU Lesser General Public License along with +// dynamic-graph. If not, see <http://www.gnu.org/licenses/>. + +#ifndef DYNAMIC_GRAPH_NULL_PTR_HH +# define DYNAMIC_GRAPH_NULL_PTR_HH + +namespace dynamicgraph +{ + const class + { + public: + template<class T> + operator T*() const + { + return 0; + } + + template<class C, class T> + operator T C::*() const + { + return 0; + } + private: + void operator&() const; + } nullptr = {}; + +} // end of namespace dynamicgraph. + +#endif //! DYNAMIC_GRAPH_NULL_PTR_HH