mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 10:21:04 +02:00
CListHelpers: allow UpDownKey with int type, too
Origin commit data
------------------
Commit: 7b87206099
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2016-01-16 (Sat, 16 Jan 2016)
This commit is contained in:
committed by
vanhofen
parent
a4ee00841a
commit
82f70043ef
@@ -21,10 +21,18 @@
|
||||
|
||||
#ifndef __LISTHELPERS__
|
||||
#define __LISTHELPERS__
|
||||
/* allow to trick the compiler into overriding template definitions */
|
||||
template<typename T> struct _id { typedef T type; };
|
||||
|
||||
class CListHelpers
|
||||
{
|
||||
public:
|
||||
template <class T> int UpDownKey(T list, neutrino_msg_t k, int lines, int sel);
|
||||
template <typename T> int UpDownKey(T list, neutrino_msg_t k, int lines, int sel) {
|
||||
return _UpDownKey(list, k, lines, sel, _id<T>());
|
||||
}
|
||||
private:
|
||||
/* stackoverflow.com/questions/3052579 */
|
||||
template <typename T> int _UpDownKey(T list, neutrino_msg_t k, int lines, int sel, _id<T>);
|
||||
int _UpDownKey(int list, neutrino_msg_t k, int lines, int sel, _id<int>);
|
||||
};
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user