Commit 6fba1fd9 authored by Tobias WEBER's avatar Tobias WEBER
Browse files

small simplification

parent 706b5082
...@@ -127,15 +127,6 @@ using remove_constref_t = typename remove_constref<T>::type; ...@@ -127,15 +127,6 @@ using remove_constref_t = typename remove_constref<T>::type;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
template<class T, T... idx>
using integer_sequence = std::integer_sequence<T, idx...>;
template<class T, T NUM>
using make_integer_sequence = std::make_integer_sequence<T, NUM>;
/** /**
* function call implementation * function call implementation
*/ */
...@@ -143,7 +134,7 @@ template<class t_func, ...@@ -143,7 +134,7 @@ template<class t_func,
class t_arg = double, template<class ...> class t_cont = std::vector, class t_arg = double, template<class ...> class t_cont = std::vector,
std::size_t... idx> std::size_t... idx>
t_arg _call_impl(t_func func, const t_cont<t_arg>& args, t_arg _call_impl(t_func func, const t_cont<t_arg>& args,
const /*std::*/integer_sequence<std::size_t, idx...>&) const std::integer_sequence<std::size_t, idx...>&)
{ {
return func(args[idx]...); return func(args[idx]...);
} }
...@@ -153,7 +144,7 @@ t_arg _call_impl(t_func func, const t_cont<t_arg>& args, ...@@ -153,7 +144,7 @@ t_arg _call_impl(t_func func, const t_cont<t_arg>& args,
*/ */
template<class t_func, class t_arg, std::size_t... idx> template<class t_func, class t_arg, std::size_t... idx>
t_arg _call_impl(t_func func, const std::array<t_arg, sizeof...(idx)>& args, t_arg _call_impl(t_func func, const std::array<t_arg, sizeof...(idx)>& args,
const /*std::*/integer_sequence<std::size_t, idx...>&) const std::integer_sequence<std::size_t, idx...>&)
{ {
return func(args[idx]...); return func(args[idx]...);
} }
...@@ -166,7 +157,7 @@ template<std::size_t iNumArgs, class t_func, ...@@ -166,7 +157,7 @@ template<std::size_t iNumArgs, class t_func,
class t_arg = double, template<class ...> class t_cont = std::vector> class t_arg = double, template<class ...> class t_cont = std::vector>
t_arg call(t_func func, const t_cont<t_arg>& args) t_arg call(t_func func, const t_cont<t_arg>& args)
{ {
using t_seq = /*std::*/make_integer_sequence<std::size_t, iNumArgs>; using t_seq = std::make_integer_sequence<std::size_t, iNumArgs>;
return _call_impl<t_func, t_arg, t_cont>(func, args, t_seq()); return _call_impl<t_func, t_arg, t_cont>(func, args, t_seq());
} }
...@@ -176,7 +167,7 @@ t_arg call(t_func func, const t_cont<t_arg>& args) ...@@ -176,7 +167,7 @@ t_arg call(t_func func, const t_cont<t_arg>& args)
template<std::size_t iNumArgs, class t_func, class t_arg = double> template<std::size_t iNumArgs, class t_func, class t_arg = double>
t_arg call(t_func func, const std::array<t_arg, iNumArgs>& args) t_arg call(t_func func, const std::array<t_arg, iNumArgs>& args)
{ {
using t_seq = /*std::*/make_integer_sequence<std::size_t, iNumArgs>; using t_seq = std::make_integer_sequence<std::size_t, iNumArgs>;
return _call_impl<t_func, t_arg>(func, args, t_seq()); return _call_impl<t_func, t_arg>(func, args, t_seq());
} }
...@@ -192,7 +183,7 @@ using _t_fkt_vararg_impl = t_arg(*)( ...@@ -192,7 +183,7 @@ using _t_fkt_vararg_impl = t_arg(*)(
template<typename t_arg, std::size_t ...idx> template<typename t_arg, std::size_t ...idx>
static _t_fkt_vararg_impl<t_arg, idx...> static _t_fkt_vararg_impl<t_arg, idx...>
_tstfkt_vararg(const integer_sequence<std::size_t, idx...>&) _tstfkt_vararg(const std::integer_sequence<std::size_t, idx...>&)
{ return nullptr; /* not interested in return value, only its type */ } { return nullptr; /* not interested in return value, only its type */ }
...@@ -202,9 +193,7 @@ _tstfkt_vararg(const integer_sequence<std::size_t, idx...>&) ...@@ -202,9 +193,7 @@ _tstfkt_vararg(const integer_sequence<std::size_t, idx...>&)
template<typename t_arg, std::size_t iNumArgs> template<typename t_arg, std::size_t iNumArgs>
using t_fkt_vararg = decltype( using t_fkt_vararg = decltype(
_tstfkt_vararg<t_arg>( _tstfkt_vararg<t_arg>(
make_integer_sequence<std::size_t, iNumArgs>())); std::make_integer_sequence<std::size_t, iNumArgs>()));
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
} }
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <fstream> #include <fstream>
#include <random> #include <random>
#include <chrono> #include <chrono>
#include <tuple>
#include <boost/version.hpp> #include <boost/version.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
...@@ -915,7 +916,6 @@ void StructFactDlg::ImportCIF() ...@@ -915,7 +916,6 @@ void StructFactDlg::ImportCIF()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/** /**
* generate symmetric nuclei from space group * generate symmetric nuclei from space group
*/ */
...@@ -962,8 +962,7 @@ void StructFactDlg::GenerateFromSG() ...@@ -962,8 +962,7 @@ void StructFactDlg::GenerateFromSG()
// add new nuclei // add new nuclei
for(const auto& nucl : generatednuclei) for(const auto& nucl : generatednuclei)
AddTabItem(-1, std::get<0>(nucl), std::get<1>(nucl), std::get<2>(nucl), std::apply(&StructFactDlg::AddTabItem, std::tuple_cat(std::make_tuple(this, -1), nucl));
std::get<3>(nucl), std::get<4>(nucl), std::get<5>(nucl), std::get<6>(nucl), std::get<7>(nucl));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment