diff --git a/iv/forward.h b/iv/forward.h new file mode 100644 index 00000000..099db815 --- /dev/null +++ b/iv/forward.h @@ -0,0 +1,10 @@ +#ifndef IV_FORWARD_H_ +#define IV_FORWARD_H_ +#include + +#define IV_FORWARD_CONSTRUCTOR(Derived, Base) \ + template \ + Derived(Args&&... args) \ + : Base(std::forward(args)...) { } + +#endif // IV_FORWARD_H_ diff --git a/iv/lv5/jsarray_iterator.h b/iv/lv5/jsarray_iterator.h index d7deebbf..ddae2476 100644 --- a/iv/lv5/jsarray_iterator.h +++ b/iv/lv5/jsarray_iterator.h @@ -1,5 +1,6 @@ #ifndef IV_LV5_JSARRAY_ITERATOR_H_ #define IV_LV5_JSARRAY_ITERATOR_H_ +#include #include #include #include @@ -56,7 +57,7 @@ class JSArrayIterator : public JSArrayIteratorSuper { return reinterpret_cast(kUniqueSymbol); } - using JSArrayIteratorSuper::JSArrayIteratorSuper; + IV_FORWARD_CONSTRUCTOR(JSArrayIterator, JSArrayIteratorSuper) }; } } // namespace iv::lv5 diff --git a/iv/lv5/jsmap_iterator.h b/iv/lv5/jsmap_iterator.h index 2e24fbdd..e3035bb2 100644 --- a/iv/lv5/jsmap_iterator.h +++ b/iv/lv5/jsmap_iterator.h @@ -1,5 +1,6 @@ #ifndef IV_LV5_JSMAP_ITERATOR_H_ #define IV_LV5_JSMAP_ITERATOR_H_ +#include #include #include #include @@ -55,7 +56,7 @@ class JSMapIterator : public JSMapIteratorSuper { return reinterpret_cast(kUniqueSymbol); } - using JSMapIteratorSuper::JSMapIteratorSuper; + IV_FORWARD_CONSTRUCTOR(JSMapIterator, JSMapIteratorSuper) }; } } // namespace iv::lv5 diff --git a/iv/lv5/jsstring_iterator.h b/iv/lv5/jsstring_iterator.h index 023aa01b..ad41e4f5 100644 --- a/iv/lv5/jsstring_iterator.h +++ b/iv/lv5/jsstring_iterator.h @@ -1,5 +1,6 @@ #ifndef IV_LV5_JSSTRING_ITERATOR_H_ #define IV_LV5_JSSTRING_ITERATOR_H_ +#include #include #include #include @@ -44,7 +45,7 @@ class JSStringIterator : public JSStringIteratorSuper { return reinterpret_cast(kUniqueSymbol); } - using JSStringIteratorSuper::JSStringIteratorSuper; + IV_FORWARD_CONSTRUCTOR(JSStringIterator, JSStringIteratorSuper) }; } } // namespace iv::lv5