Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • Are you able to make the data something that you could store a pointer to in the user data area for the window? As in, some combination of pImpl and SetWindowLongPtr? Commented Aug 9, 2013 at 1:00
  • 1
    How about using pimpl? Commented Aug 9, 2013 at 1:21
  • From preliminary searches of pimpl, it's an interesting concept. I will have to look into it more before I come back with a definitive answer. Commented Aug 9, 2013 at 1:23
  • 1
    "This works because DeviceChanger instances have the exact same memory structure as Device,": no, it works because undefined behavior sometimes happens to do what you expect. The language definition does not require this to do anything sensible. Commented Aug 9, 2013 at 1:39
  • 1
    I think you're trying too hard. There's nothing wrong with declaring functions in a header and making them friends. If you write good documentation your users won't be thumbing through headers to figure out how to use your code. Commented Aug 9, 2013 at 1:40