Q:

Getting error code C2228: left of '._Ptr' must have class/struct/union

I am getting this strange error code when I try to execute this line of code.
cType += file_size(is_directory( d->status()));
Here is part of the code leading up to the error.
void scan(string switches, path const& f, unsigned k = 0)
{
    // Declare file types
    long long cppType = 0, cType = 0,
        hType = 0, hppType = 0,
        hxxType = 0, javaType = 0,
        totalClassType = 0, aviType = 0,
        mkvType = 0, mpegType = 0,
        mp4Type = 0, mp3Type = 0;

    int cpp = 0, c = 0, h = 0, hpp = 0, hxx = 0, java = 0,
        totalClass = 0, avi = 0, mkv = 0, mpeg = 0, mp4 = 0, mp3 = 0;

    int totalBytes = 0;
    string indent(k, '\t');
    directory_iterator temp;
    directory_iterator d(f);        //f = the first file in folder to be processed
    directory_iterator e;           // signals end of folder

    bool isReverse = false;
    bool isRecursive = false;

    path pth;
    pth = d->path();

    for (unsigned check = 0; check < switches.size(); ++check)
    {
        if (switches[check] == 'r')
        {
            isRecursive = true;
        }

        else if (switches[check] == 'R')
        {
            isReverse = true;
        }
    }

    for (unsigned int i = 0; i < switches.size(); ++i)
    {
        if (switches[i] == 'c')
            //OPTION c: Locate c++ files - extension(s): .c,. cpp, .h, .hpp, .hxx
        {
            if (pth.extension() == ".c")
            {
                c++;
                cType += file_size(is_directory(d->status()));
            }

Any help is very much appreciated!

A:

is_directory() returns a bool, not a Path, which is what file_size() takes as an argument.
The error you get probably means that file_size() is a macro, which means that this:
file_size(is_directory( d->status()))

is being expanded at some point to:
is_directory( d->status())._Ptr

which can't work, since the . operator can't be applied to bool values.

