I have a quick question while reading a source code. AFAIK, the name of a constructor should be identical to the class declared. But, the following code has a different name as a constructor. Anybody can tell me why this code works?
class directFieldMapper
:
public FieldMapper
{
const labelUList& directAddressing_;
bool hasUnmapped_;
public:
// Constructors
//- Construct given addressing
patchFieldSubset(const labelUList& directAddressing)
:
directAddressing_(directAddressing),
hasUnmapped_(false)
{
if (directAddressing_.size() && min(directAddressing_) < 0)
{
hasUnmapped_ = true;
}
}
//- Destructor
virtual ~directFieldMapper()
{}
}
Ok, I found that this class is not in the source code list in the Makefile. So, this class is never compiled.
patchFieldSubsetbe a nested class insidedirectFieldMapper, and you just missed/accidentally omitted the relevant code? Indentation suggests that that could be possible.