[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] How to mark/copy objects in C++
From: |
Gabriel Dos Reis |
Subject: |
Re: [Texmacs-dev] How to mark/copy objects in C++ |
Date: |
24 May 2004 21:11:54 +0200 |
Joris van der Hoeven <address@hidden> writes:
| A question for Gabriel: would there be an easy way to implement
| type-safe marking/copying routines in C++ for all TeXmacs types.
| Of course, we can manually write such routines for each type,
| but there might be a more automatic way. What do you think?
One more tip. If you have a polymophic type T, and a pointer "p" of
type *T -- that may actually points to a complete object of type U
derived from T, then
dynamic_cast<void*>(p)
gives you a pointer to the start of the storage of the complete
object. Therefore, you would be able to mark the complete object and
you would need to implement the specific bits of marking/copying only
for the "leaves classes" or "sealed classes", i.e. those from which
you no longer derive from. That gives you something very general.
-- Gaby
- Re: [Texmacs-dev] More Scheme benchmarks, (continued)
- [Texmacs-dev] Bigloo?, Joris van der Hoeven, 2004/05/23
- Re: [Texmacs-dev] Bigloo?, Joris van der Hoeven, 2004/05/24
- Re: [Texmacs-dev] Bigloo?, Gabriel Dos Reis, 2004/05/24
- [Texmacs-dev] How to mark/copy objects in C++, Joris van der Hoeven, 2004/05/24
- Re: [Texmacs-dev] How to mark/copy objects in C++,
Gabriel Dos Reis <=
- Re: [Texmacs-dev] How to mark/copy objects in C++, Joris van der Hoeven, 2004/05/25
- Re: [Texmacs-dev] How to mark/copy objects in C++, Gabriel Dos Reis, 2004/05/24
- Re: [Texmacs-dev] How to mark/copy objects in C++, Joris van der Hoeven, 2004/05/25
- Re: [Texmacs-dev] How to mark/copy objects in C++, David Allouche, 2004/05/25
- Re: [Texmacs-dev] How to mark/copy objects in C++, Joris van der Hoeven, 2004/05/26
- Re: [Texmacs-dev] Bigloo?, David MENTRE, 2004/05/24
- Re: [Texmacs-dev] Bigloo?, Joris van der Hoeven, 2004/05/24
- Re: [Texmacs-dev] Bigloo?, Gabriel Dos Reis, 2004/05/24
- Re: [Texmacs-dev] Bigloo?, David MENTRE, 2004/05/24
- Re: [Texmacs-dev] Bigloo?, Joris van der Hoeven, 2004/05/25