Using 'using' instead of 'typedef'

This commit is contained in:
Wenhai Lin
2016-04-07 15:47:05 +08:00
parent 0e7cb5da16
commit 9dffef8763
4 changed files with 9 additions and 9 deletions
+2 -1
View File
@@ -36,7 +36,8 @@
#define PCMDATA_CACHEMAXSIZE 1048576
typedef ALvoid AL_APIENTRY (*alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq);
using alBufferDataStaticProcPtr = ALvoid AL_APIENTRY (*)(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq);
static ALvoid alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq)
{
static alBufferDataStaticProcPtr proc = NULL;
+2 -2
View File
@@ -66,9 +66,9 @@ public:
// ------------------------------------------
/** Iterator, can be used to loop the Map. */
typedef typename RefMap::iterator iterator;
using iterator = typename RefMap::iterator;
/** Const iterator, can be used to loop the Map. */
typedef typename RefMap::const_iterator const_iterator;
using const_iterator = typename RefMap::const_iterator;
/** Return iterator to beginning. */
iterator begin() { return _data.begin(); }
+4 -4
View File
@@ -53,14 +53,14 @@ public:
// ------------------------------------------
/** Iterator, can be used to loop the Vector. */
typedef typename std::vector<T>::iterator iterator;
using iterator = typename std::vector<T>::iterator;
/** Const iterator, can be used to loop the Vector. */
typedef typename std::vector<T>::const_iterator const_iterator;
using const_iterator = typename std::vector<T>::const_iterator;
/** Reversed iterator, can be used to loop the Vector in reverse sequence. */
typedef typename std::vector<T>::reverse_iterator reverse_iterator;
using reverse_iterator = typename std::vector<T>::reverse_iterator;
/** Reversed iterator, can be used to loop the Vector in reverse sequence. */
typedef typename std::vector<T>::const_reverse_iterator const_reverse_iterator;
using const_reverse_iterator = typename std::vector<T>::const_reverse_iterator;
/** Returns an iterator pointing the first element of the Vector. */
iterator begin() { return _data.begin(); }
@@ -231,8 +231,7 @@ void ActionTimeline::step(float delta)
}
}
typedef std::function<void(Node*)> tCallBack;
void foreachNodeDescendant(Node* parent, tCallBack callback)
static void foreachNodeDescendant(Node* parent, std::function<void(Node*)> callback)
{
callback(parent);