Opened 21 years ago

Closed 16 years ago

#66 closed Feature Requests (Wont Fix)

thread specific pointer behavior change

Reported by: nobody Owned by: Roland Schwarz
Milestone: Component: None
Version: None Severity:
Keywords: Cc:

Description

The thread specific pointer class seems to imply that only heap allocated pointers are eligible 
for use in the thread specific pointer (i.e. both reset and cleanup use delete object).

Is it possible to make the cleanup action declarable in the template such that we have someting 
along the likes of:

template <typename T, typename Cleanup>
class ... {
	reset(T *new) { ... cleanup(cur);.... }

	cleanup(void *cur) {
		Cleanup c;

		c(cur);
	}
}

or some such.

This would allow the use of say reference counted or even stack objects to be used in thread 
local pointers.



Change History (1)

comment:1 by Roland Schwarz, 16 years ago

Status: assignedclosed
Logged In: YES 
user_id=541730

I don't think anything than heap located pointers should be
allowed.
An useful counter example would be interesting.
Note: See TracTickets for help on using tickets.