C
Chris Thomasson
I am working on a high-speed futures implementation in C++, and was
tinkering around with ways to wrap the function pointer logic. I am a
C/Assembly programmer that doesn't make a lot of use of C++. So my skills
can be improved upon for sure. I was wondering if I was subjecting my first
attempt at a function pointer to any undefined behavior(s). Here is the
code:
http://appcore.home.comcast.net/vzoom/raii/scope-guard.cpp
I'm basically using Andrei and Petru scopeguard technique, with one small
tweak: I am using a function pointer to the templated call details, instead
of a boolean. That way I can use it like a scopeguard by testing the value
of the function pointer against NULL, and I can call it like a virtual
function of sorts. So, I can call it virtually, or locally through the
templated SafeWxecute function... Does this sound Kosher to you C++ gurus'?
;^)
Thank you all for your time,
Chris Thomasson
tinkering around with ways to wrap the function pointer logic. I am a
C/Assembly programmer that doesn't make a lot of use of C++. So my skills
can be improved upon for sure. I was wondering if I was subjecting my first
attempt at a function pointer to any undefined behavior(s). Here is the
code:
http://appcore.home.comcast.net/vzoom/raii/scope-guard.cpp
I'm basically using Andrei and Petru scopeguard technique, with one small
tweak: I am using a function pointer to the templated call details, instead
of a boolean. That way I can use it like a scopeguard by testing the value
of the function pointer against NULL, and I can call it like a virtual
function of sorts. So, I can call it virtually, or locally through the
templated SafeWxecute function... Does this sound Kosher to you C++ gurus'?
;^)
Thank you all for your time,
Chris Thomasson