Skip to content

Commit 384f025

Browse files
committed
Allow to compile with g++-4.8
1 parent f9e6cc8 commit 384f025

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/Command.cc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ using namespace zypp;
4949
///////////////////////////////////////////////////////////////////
5050
namespace
5151
{
52+
#define EXPAND_PARAMETER_PACKS_IN_LAMBDAS
53+
#ifdef __GNUC__
54+
# if !__GNUC_PREREQ(4,9)
55+
# undef EXPAND_PARAMETER_PACKS_IN_LAMBDAS
56+
# endif
57+
#endif
58+
59+
#ifdef EXPAND_PARAMETER_PACKS_IN_LAMBDAS
5260
template < typename T, typename ... Args >
5361
ZypperCommand::CmdDesc makeCmd ( ZypperCommand::Command comm, std::string &&category, std::vector< const char * > &&aliases, Args&&... args ) {
5462
return std::make_tuple(comm, std::move( category ), aliases,
@@ -57,6 +65,25 @@ namespace
5765
})
5866
);
5967
}
68+
#else
69+
template < typename T >
70+
ZypperCommand::CmdDesc makeCmd ( ZypperCommand::Command comm, const std::string &&category, std::vector<const char *> &&aliases ) {
71+
return std::make_tuple(comm, category, aliases,
72+
ZypperCommand::CmdFactory( [ aliases ]() {
73+
return std::make_shared<T>( std::vector<std::string>( aliases.begin(), aliases.end() ) );
74+
})
75+
);
76+
}
77+
78+
template < typename T, typename AliasMode >
79+
ZypperCommand::CmdDesc makeCmd ( ZypperCommand::Command comm, const std::string &&category, std::vector<const char *> &&aliases, AliasMode mode ) {
80+
return std::make_tuple(comm, category, aliases,
81+
ZypperCommand::CmdFactory( [ aliases, mode ]() {
82+
return std::make_shared<T>( std::vector<std::string>( aliases.begin(), aliases.end() ), mode );
83+
})
84+
);
85+
}
86+
#endif
6087

6188
ZypperBaseCommandPtr voidCmd ( )
6289
{

0 commit comments

Comments
 (0)