Skip to content
Snippets Groups Projects
Commit d1e4abcc authored by Jan Travnicek's avatar Jan Travnicek Committed by Jan Trávníček
Browse files

shorten extended variant definition

parent 29691cb6
No related branches found
No related tags found
1 merge request!95Many clang-tidy fixes
...@@ -64,38 +64,6 @@ struct variant_builder_impl < std::variant < ResTs ... > > : public std::variant ...@@ -64,38 +64,6 @@ struct variant_builder_impl < std::variant < ResTs ... > > : public std::variant
* Inherit constructors of the standard variant * Inherit constructors of the standard variant
*/ */
using std::variant < ResTs ... >::variant; using std::variant < ResTs ... >::variant;
/**
* Inherit operator = of the standard variant
*/
using std::variant < ResTs ... >::operator=;
#ifndef __clang__
/**
* Default constructor needed by g++ since it is not inherited
*/
variant_builder_impl ( ) = default;
/**
* Copy constructor needed by g++ since it is not inherited
*/
variant_builder_impl ( const variant_builder_impl & other ) = default;
/**
* Move constructor needed by g++ since it is not inherited
*/
variant_builder_impl ( variant_builder_impl && other ) = default;
/**
* Copy operator = needed by g++ since it is not inherited
*/
variant_builder_impl & operator = ( variant_builder_impl && other ) = default;
/**
* Move operator = needed by g++ since it is not inherited
*/
variant_builder_impl & operator = ( const variant_builder_impl & other ) = default;
#endif
}; };
   
/** /**
...@@ -112,38 +80,6 @@ struct variant_builder_impl < std::variant < ResTs ... >, T, Ts ... > : public v ...@@ -112,38 +80,6 @@ struct variant_builder_impl < std::variant < ResTs ... >, T, Ts ... > : public v
* Inherit constructors of the standard variant * Inherit constructors of the standard variant
*/ */
using variant_builder_impl < typename std::conditional < is_in < T, ResTs ... >::value, std::variant < ResTs ... >, std::variant < ResTs ..., T > >::type, Ts ... >::variant_builder_impl; using variant_builder_impl < typename std::conditional < is_in < T, ResTs ... >::value, std::variant < ResTs ... >, std::variant < ResTs ..., T > >::type, Ts ... >::variant_builder_impl;
/**
* Inherit operator = of the standard variant
*/
using variant_builder_impl < typename std::conditional < is_in < T, ResTs ... >::value, std::variant < ResTs ... >, std::variant < ResTs ..., T > >::type, Ts ... >::operator =;
#ifndef __clang__
/**
* Default constructor needed by g++ since it is not inherited
*/
variant_builder_impl ( ) = default;
/**
* Copy constructor needed by g++ since it is not inherited
*/
variant_builder_impl ( const variant_builder_impl & other ) = default;
/**
* Move constructor needed by g++ since it is not inherited
*/
variant_builder_impl ( variant_builder_impl && other ) = default;
/**
* Copy operator = needed by g++ since it is not inherited
*/
variant_builder_impl & operator = ( variant_builder_impl && other ) = default;
/**
* Move operator = needed by g++ since it is not inherited
*/
variant_builder_impl & operator = ( const variant_builder_impl & other ) = default;
#endif
}; };
   
template < class T, class ... Ts > template < class T, class ... Ts >
...@@ -152,38 +88,6 @@ struct variant_builder_start : public variant_builder_impl < std::variant < T >, ...@@ -152,38 +88,6 @@ struct variant_builder_start : public variant_builder_impl < std::variant < T >,
* Inherit constructors of the standard variant * Inherit constructors of the standard variant
*/ */
using variant_builder_impl < std::variant < T >, Ts ... >::variant_builder_impl; using variant_builder_impl < std::variant < T >, Ts ... >::variant_builder_impl;
/**
* Inherit operator = of the standard variant
*/
using variant_builder_impl < std::variant < T >, Ts ... >::operator =;
#ifndef __clang__
/**
* Default constructor needed by g++ since it is not inherited
*/
variant_builder_start ( ) = default;
/**
* Copy constructor needed by g++ since it is not inherited
*/
variant_builder_start ( const variant_builder_start & other ) = default;
/**
* Move constructor needed by g++ since it is not inherited
*/
variant_builder_start ( variant_builder_start && other ) = default;
/**
* Copy operator = needed by g++ since it is not inherited
*/
variant_builder_start & operator = ( variant_builder_start && other ) = default;
/**
* Move operator = needed by g++ since it is not inherited
*/
variant_builder_start & operator = ( const variant_builder_start & other ) = default;
#endif
}; };
   
/** /**
...@@ -302,7 +206,7 @@ public: ...@@ -302,7 +206,7 @@ public:
/** /**
* Inherit operator = of the standard variant * Inherit operator = of the standard variant
*/ */
using variant_builder_start < Ts ... >::operator =; using variant_builder_start < Ts ... >::__std__variant::operator=;
#ifndef __clang__ #ifndef __clang__
   
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment