From Nightfox@DIGDIST to All on Thursday, May 24, 2018 12:44:13
A while ago, I heard that one method that some people were using to unit test a class was to use this to be able to access private members of a class:
#define private public
That way, you could perform a test and access the private members of a class to ensure the test results are what was expected. When I heard about that, I thought it was clever, but seemed wrong to do that. And some would argue that you probably wouldn't need to directly verify the private members of a class instance..
Also, I remember hearing that in a more recent version of C++ (C++11? C++14?), using #define to re-define language keywords is now considered an error, so it is no longer allowed in the language..
Nightfox
---
þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
Who's Online
Recent Visitors
Elija Barnes
Sunday, March 01, 2026 20:14:37
from
Fairborne, Tx
via
HTTPS
Elija Barnes
Saturday, February 28, 2026 19:09:25
from
Fairborne, Tx
via
HTTPS
George H
Friday, February 27, 2026 12:17:56
from
Buffolo, Ny
via
HTTPS
George H
Monday, February 23, 2026 23:12:08
from
Buffolo, Ny
via
HTTPS
Elija Barnes
Monday, February 23, 2026 23:05:47
from
Fairborne, Tx
via
HTTPS
Jim Bob
Monday, February 23, 2026 22:53:59
from
Idaho
via
HTTPS