mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-09 09:32:20 +00:00
Added "Emitter" functor to allow easy emitting of elements of a container
using std::for_each. llvm-svn: 44589
This commit is contained in:
parent
0317aeb4b6
commit
ca0cb926f4
@ -37,6 +37,17 @@ public:
|
||||
template <typename T>
|
||||
inline void Emit(const T& X) { SerializeTrait<T>::Emit(*this,X); }
|
||||
|
||||
template <typename T>
|
||||
struct Emitter {
|
||||
Serializer &S;
|
||||
|
||||
Emitter(Serializer& s) : S(s) {}
|
||||
void operator()(const T& x) const { S.Emit(x); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
Emitter<T> MakeEmitter() { return Emitter<T>(*this); }
|
||||
|
||||
void EmitInt(uint64_t X);
|
||||
void EmitSInt(int64_t X);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user