Question: When compiling a library I get the following error related to the function below:

> 
> error: no matching function for call to ‘Factor::inplaceCancel(const
>  Factor\*&)’
> 
> 
> 

I don't understand why the `const Factor* rhsFPtr` is being treated as a `const Factor*&`.
Could anyone perhaps help me with this?

```
void InplaceCancelFF::inplaceProcess(FactorisedFactor* lhsPtr, const Factor* rhsFPtr){
   lhsPtr->factorPtrs[0]->inplaceCancel(rhsFPtr);
   ...
}
//In the abstract Factor Class:
virtual void inplaceCancel(const Factor* rhsPtr,FactorOperator* procPtr) = 0;
//In the child class:
inline void inplaceCancel(const Factor* rhsPtr, FactorOperator* procPtr = 0);

```

Answer: 
Get rid of `subscribers` column:

```
SELECT  [period],
        providerid, 
        [1] as SMS, 
        [2] as [Data], 
        [3] as [minutes]
FROM (
    SELECT [period],providerid, [type], volume
    FROM YourTable         
) as t
PIVOT (
    MAX(volume) FOR [type] in ([1], [2], [3]) 
) as P

```

Output:

```
period      providerid  SMS     Data    minutes
Aug-2016    7           4027917 5325430 8722165
Jul-2016    7           2981655 6449570 7702484

```
When you use `1 AS SMS` it reads `1` as the number 1. Instead you should tell it that you mean the column i.e. `[1]`.
Also I'm not too sure how the column `subscribers` is used, so when you are pivoting you might want to remove it.

I.e. Try;

```
select   period,providerid,[1] as SMS,[2] as Data,[3] as minutes
FROM   (SELECT Period, ProviderID, Type, Volume 
       FROM #P) X         
PIVOT(
   sum(volume)
   FOR [type] in ([1],[2],[3]) 
)as P

```