PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::CCandidateInfo Class Reference

#include <Puma/CCandidateInfo.h>

Description

Representation of a candidate for the C++ function overload resolution mechanism.

Such a candidate stores the candidate function and the conversion sequences of the function call arguments needed to match the function parameter types of the overloaded function. In special situations it is possible that the overload resolution selects a function that hasn't been parsed, yet, because of delayed parsing of member functions and the initializers of their arguments. Here is an example:

struct has_deref {
template <typename Type> static long test(Type *, Type * = 42);
static char test(void *);
static const int value = sizeof(test((long *) 0));
};

Here the first 'test' is selected, but an error message will have to be issued. This is not considered as a substitution fault, which would have to be ignored ("SFINAE"). The '_delayed' attribute indicates this situation.

Public Member Functions

 CCandidateInfo (CFunctionInfo *fi)
 Constructor.
 
 ~CCandidateInfo ()
 Destructor.
 
CFunctionInfoFunction () const
 Get the candidate function.
 
void Function (CFunctionInfo *fi)
 Set the candidate function.
 
void markDelayedParseProblem ()
 Mark the candidate as erroneous due to delayed parsing.
 
bool hasDelayedParseProblem () const
 Get the delayed parsing problem flag.
 
void addConvSequence (CCConvSeq *seq)
 Add a conversion sequence for a function argument.
 
unsigned ConvSequences () const
 Get the number of the conversion sequences.
 
CCConvSeqConvSequence (unsigned n)
 Get the n-th conversion sequence.
 
void SecondConvSeq (CCConvSeq *seq)
 Set the second conversion sequence.
 
CCConvSeqSecondConvSeq () const
 Get the second conversion sequence.
 

Constructor & Destructor Documentation

◆ CCandidateInfo()

Puma::CCandidateInfo::CCandidateInfo ( CFunctionInfo * fi)
inline

Constructor.

Parameters
fiThe candidate function.

◆ ~CCandidateInfo()

Puma::CCandidateInfo::~CCandidateInfo ( )
inline

Destructor.

Member Function Documentation

◆ addConvSequence()

void Puma::CCandidateInfo::addConvSequence ( CCConvSeq * seq)
inline

Add a conversion sequence for a function argument.

The conversion sequences are added in the order of the arguments of the function call.

Parameters
seqThe conversion sequence.

◆ ConvSequence()

CCConvSeq * Puma::CCandidateInfo::ConvSequence ( unsigned n)
inline

Get the n-th conversion sequence.

The n-th conversion sequence corresponds to the n-th function call argument.

Parameters
nThe conversion sequence or NULL if n is invalid.

◆ ConvSequences()

unsigned Puma::CCandidateInfo::ConvSequences ( ) const
inline

Get the number of the conversion sequences.

◆ Function() [1/2]

CFunctionInfo * Puma::CCandidateInfo::Function ( ) const
inline

Get the candidate function.

◆ Function() [2/2]

void Puma::CCandidateInfo::Function ( CFunctionInfo * fi)
inline

Set the candidate function.

Parameters
fiThe candidate function.

◆ hasDelayedParseProblem()

bool Puma::CCandidateInfo::hasDelayedParseProblem ( ) const
inline

Get the delayed parsing problem flag.

◆ markDelayedParseProblem()

void Puma::CCandidateInfo::markDelayedParseProblem ( )
inline

Mark the candidate as erroneous due to delayed parsing.

◆ SecondConvSeq() [1/2]

CCConvSeq * Puma::CCandidateInfo::SecondConvSeq ( ) const
inline

Get the second conversion sequence.

◆ SecondConvSeq() [2/2]

void Puma::CCandidateInfo::SecondConvSeq ( CCConvSeq * seq)
inline

Set the second conversion sequence.

This is a user-defined conversion by means of a user-defined conversion function.

Parameters
seqThe conversion sequence.