From f607e341153a815efdcc7dbb3d5ff3348b9491ee Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Thu, 21 Jun 2018 17:15:56 +0200
Subject: [PATCH] continue documenting alib2std

---
 alib2std/src/extensions/array.hpp  |  2 +-
 alib2std/src/extensions/bitset.hpp | 77 +++++++++++++++++++++++++++
 alib2std/src/extensions/deque.hpp  | 84 +++++++++++++++++++++++++++++-
 3 files changed, 160 insertions(+), 3 deletions(-)

diff --git a/alib2std/src/extensions/array.hpp b/alib2std/src/extensions/array.hpp
index 136d49744b..4220df88f2 100644
--- a/alib2std/src/extensions/array.hpp
+++ b/alib2std/src/extensions/array.hpp
@@ -150,7 +150,7 @@ struct compare < ext::array < T, N > > {
 /**
  * Overload of to_string function.
  *
- * \param value the value to be converted to string
+ * \param value the array to be converted to string
  *
  * \tparam T the type of values inside the array
  * \tparam N the size of the array
diff --git a/alib2std/src/extensions/bitset.hpp b/alib2std/src/extensions/bitset.hpp
index 3aba954f8b..df779e177d 100644
--- a/alib2std/src/extensions/bitset.hpp
+++ b/alib2std/src/extensions/bitset.hpp
@@ -1,6 +1,22 @@
 /*
  * bitset.hpp
  *
+ * This file is part of Algorithms library toolkit.
+ * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz)
+
+ * Algorithms library toolkit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+
+ * Algorithms library toolkit 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 Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with Algorithms library toolkit.  If not, see <http://www.gnu.org/licenses/>.
+ *
  * Created on: May 04, 2017
  * Author: Jan Travnicek
  */
@@ -17,25 +33,65 @@
 
 namespace ext {
 
+/**
+ * Class extending the bitset class from the standard library. Original reason is to allow printing of the container with overloaded operator <<.
+ *
+ * The class mimics the behavior of the bitset from the standatd library.
+ *
+ * \tparam N the size of the bitset
+ */
 template < std::size_t N >
 class bitset : public std::bitset < N > {
 public:
+	/**
+	 * Inherit constructors of the standard bitset
+	 */
 	using std::bitset < N >::bitset;
+
+	/**
+	 * Inherit operator = of the standard bitset
+	 */
 	using std::bitset < N >::operator =;
 #ifndef __clang__
+
+	/**
+	 * Default constructor needed by g++ since it is not inherited
+	 */
 	bitset ( ) noexcept : std::bitset < N > ( ) {
 	}
 
+	/**
+	 * Copy constructor needed by g++ since it is not inherited
+	 */
 	bitset ( const bitset & other ) = default;
 
+	/**
+	 * Move constructor needed by g++ since it is not inherited
+	 */
 	bitset ( bitset && other ) = default;
 
+	/**
+	 * Copy operator = needed by g++ since it is not inherited
+	 */
 	bitset & operator = ( bitset && other ) = default;
 
+	/**
+	 * Move operator = needed by g++ since it is not inherited
+	 */
 	bitset & operator = ( const bitset & other ) = default;
 #endif
 };
 
+/**
+ * Operator to print the bitset to the output stream.
+ *
+ * \param out the output stream
+ * \param bitset the bitset to print
+ *
+ * \tparam N the size of the bitset
+ *
+ * \return the output stream from the \p out
+ */
 template < size_t N >
 std::ostream & operator << ( std::ostream & out, const ext::bitset < N > & bitset ) {
 	out << "[";
@@ -49,8 +105,22 @@ std::ostream & operator << ( std::ostream & out, const ext::bitset < N > & bitse
 	return out;
 }
 
+/**
+ * Specialisation of the compare structure implementing the three-way comparison
+ *
+ * \tparam N the size of the bitset
+ */
 template < size_t N >
 struct compare < ext::bitset < N > > {
+
+	/**
+	 * Implementation of the three-way comparison
+	 *
+	 * \param first the left operand of the comparison
+	 * \param second the right operand of the comparison
+	 *
+	 * \return negative value of left < right, positive value if left > right, zero if left == right
+	 */
 	int operator ( ) ( const ext::bitset < N > & first, const ext::bitset < N > & second ) const {
 		for ( size_t i = 0; i < N; ++i ) {
 			int res = first [ i ] != second [ i ];
@@ -61,6 +131,13 @@ struct compare < ext::bitset < N > > {
 	}
 };
 
+/**
+ * Overload of to_string function.
+ *
+ * \param value the bitset to be converted to string
+ *
+ * \tparam N the size of the bitset
+ */
 template < size_t N >
 std::string to_string ( const ext::bitset < N > & value ) {
 	std::stringstream ss;
diff --git a/alib2std/src/extensions/deque.hpp b/alib2std/src/extensions/deque.hpp
index db616ac78d..52c191a0c0 100644
--- a/alib2std/src/extensions/deque.hpp
+++ b/alib2std/src/extensions/deque.hpp
@@ -1,6 +1,22 @@
 /*
  * deque.hpp
  *
+ * This file is part of Algorithms library toolkit.
+ * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz)
+
+ * Algorithms library toolkit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+
+ * Algorithms library toolkit 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 Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with Algorithms library toolkit.  If not, see <http://www.gnu.org/licenses/>.
+ *
  * Created on: Apr 1, 2013
  * Author: Jan Travnicek
  */
@@ -18,25 +34,66 @@
 
 namespace ext {
 
+/**
+ * Class extending the deque class from the standard library. Original reason is to allow printing of the container with overloaded operator <<.
+ *
+ * The class mimics the behavior of the deque from the standatd library.
+ *
+ * \tparam T the type of values inside the deque
+ * \tparam Ts ... remaining unimportant template parameters of the deque
+ */
 template < class T, class Alloc = std::allocator < T > >
 class deque : public std::deque < T, Alloc >, AllocFix < Alloc > {
 public:
+	/**
+	 * Inherit constructors of the standard deque
+	 */
 	using std::deque < T, Alloc >::deque;
+
+	/**
+	 * Inherit operator = of the standard deque
+	 */
 	using std::deque < T, Alloc >::operator =;
 #ifndef __clang__
-	deque ( ) noexcept : std::deque < T, Alloc > ( ) {
-	}
 
+	/**
+	 * Default constructor needed by g++ since it is not inherited
+	 */
+	deque ( ) = default;
+
+	/**
+	 * Copy constructor needed by g++ since it is not inherited
+	 */
 	deque ( const deque & other ) = default;
 
+	/**
+	 * Move constructor needed by g++ since it is not inherited
+	 */
 	deque ( deque && other ) = default;
 
+	/**
+	 * Copy operator = needed by g++ since it is not inherited
+	 */
 	deque & operator = ( deque && other ) = default;
 
+	/**
+	 * Move operator = needed by g++ since it is not inherited
+	 */
 	deque & operator = ( const deque & other ) = default;
 #endif
 };
 
+/**
+ * Operator to print the deque to the output stream.
+ *
+ * \param out the output stream
+ * \param deque the deque to print
+ *
+ * \tparam T the type of values inside the deque
+ * \tparam Ts ... remaining unimportant template parameters of the deque
+ *
+ * \return the output stream from the \p out
+ */
 template < class T, class ... Ts >
 std::ostream & operator <<( std::ostream & out, const ext::deque < T, Ts ... > & list ) {
 	out << "[";
@@ -54,8 +111,23 @@ std::ostream & operator <<( std::ostream & out, const ext::deque < T, Ts ... > &
 	return out;
 }
 
+/**
+ * Specialisation of the compare structure implementing the three-way comparison
+ *
+ * \tparam T the type of values inside the deque
+ * \tparam Ts ... remaining unimportant template parameters of the deque
+ */
 template < class T, class ... Ts >
 struct compare < ext::deque < T, Ts ... > > {
+
+	/**
+	 * Implementation of the three-way comparison
+	 *
+	 * \param first the left operand of the comparison
+	 * \param second the right operand of the comparison
+	 *
+	 * \return negative value of left < right, positive value if left > right, zero if left == right
+	 */
 	int operator ()( const ext::deque < T, Ts ... > & first, const ext::deque < T, Ts ... > & second ) const {
 		if ( first.size ( ) < second.size ( ) ) return -1;
 
@@ -74,6 +146,14 @@ struct compare < ext::deque < T, Ts ... > > {
 
 };
 
+/**
+ * Overload of to_string function.
+ *
+ * \param value the deque to be converted to string
+ *
+ * \tparam T the type of values inside the deque
+ * \tparam Ts ... remaining unimportant template parameters of the deque
+ */
 template < class T, class ... Ts >
 std::string to_string ( const ext::deque < T, Ts ... > & value ) {
 	std::stringstream ss;
-- 
GitLab