Puma Reference Manual Puma::CCandidateInfo Class Reference



Puma::CCandidateInfo Class Reference

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

#include <Puma/CCandidateInfo.h>

List of all members.

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.

Detailed 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.


Constructor & Destructor Documentation

Constructor.

Parameters:
fiThe candidate function.

Destructor.


Member Function Documentation

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.
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.
unsigned Puma::CCandidateInfo::ConvSequences ( ) const [inline]

Get the number of the conversion sequences.

Get the candidate function.

Set the candidate function.

Parameters:
fiThe candidate function.

Get the delayed parsing problem flag.

Mark the candidate as erroneous due to delayed parsing.

Set the second conversion sequence.

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

Parameters:
seqThe conversion sequence.

Get the second conversion sequence.