Questions tagged [fancy-pointers]

4 questions
7
votes
2 answers

What are the requirements for implementing an allocator with a fancy pointer which works with STL containers?

I am attempting to implement an Allocator which allows me to use a 'fancy' pointer along the lines of boost::interprocess::offset_ptr with STL types. As a self contained template the pointer itself works well but I am having trouble getting it to…
Bruce Adams
  • 4,953
  • 4
  • 48
  • 111
4
votes
1 answer

How do I implement a operator-> for a fancy pointer to external memory?

I'm implementing a fancy pointer type which wraps a parallel memory controller, for pointer-like reading to and writing from external SDRAM. The usage requirements are somewhat as following: // High level overview of class definition: class…
Julian vD
  • 154
  • 9
4
votes
1 answer

Should every fancy pointer be an iterator?

I'm working on a segment-based memory allocator for C++. In this allocator, when you deallocate a chunk of memory, you have to know which segment it came from. Therefore, I'm storing a pointer to the segment as a member of the fancy pointer returned…
Quuxplusone
  • 23,928
  • 8
  • 94
  • 159
1
vote
0 answers

How to handle implicit and explicit type conversions between const and non-const fancy pointers?

Given the type definitions using ConstHandle = MyEntity const*; using Handle = MyEntity*; it is possible to conduct the following type conversions: Handle → ConstHandle (implicit) ConstHandle → Handle (explicit via const_cast) Handle* →…
precarious
  • 598
  • 2
  • 14