diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-21 19:57:31 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-22 12:43:06 +0100 |
commit | 329e3092542067f3a99fda328a8118e8d024e054 (patch) | |
tree | c1ccf987b3a616a46405cd7f788b4bc78767f7bf /pair.inc.h | |
parent | Fix c++ compile warnings. (diff) | |
download | calp-329e3092542067f3a99fda328a8118e8d024e054.tar.gz calp-329e3092542067f3a99fda328a8118e8d024e054.tar.xz |
Build, but doesn't link.
Diffstat (limited to '')
-rw-r--r-- | pair.inc.h | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -1,7 +1,8 @@ -#if ! (defined(T) && defined(V)) -#error "Both T and V must be defiend here" -#else +// #if ! (defined(T) && defined(V)) +// #error "Both T and V must be defiend here" +// #else +#if 0 INIT_F(PAIR(T, V)) { INIT(T, &self->key); INIT(V, &self->val); @@ -24,11 +25,16 @@ FMT_F(PAIR(T, V)) { return sprintf(buf, "<%s, %s>", lbuf, rbuf); } - -int DEEP_COPY(PAIR(T, V)) (PAIR(T, V)* dest, PAIR(T, V)* src) { - DEEP_COPY(T)(&dest->key, &src->key); - DEEP_COPY(V)(&dest->val, &src->val); - return 0; +#endif + +// int DEEP_COPY(PAIR(T, V)) (PAIR(T, V)* dest, PAIR(T, V)* src) { +template <class T, class V> +pair<T, V>::pair (pair<T,V>& other) { + this->key = new T(*other.key); + this->val = new V(*other.val); + // DEEP_COPY(T)(&dest->key, &src->key); + // DEEP_COPY(V)(&dest->val, &src->val); + // return 0; } -#endif /* T & V */ +// #endif /* T & V */ |