Reading from [here](http://www.cprogramming.com/c++11/c++11-auto-decltype-return-value-after-function.html), this C++11 code seems weird to me:

```
template <typename Builder>
auto
makeAndProcessObject (const Builder& builder) -> decltype( builder.makeObject() )
{
    auto val = builder.makeObject();
    // do stuff with val
    return val;
}

```

I have several questions:

1) Does the decltype(builder.makeObject()) calls one additional time the makeObject function before the actual call is performed?

2) If not and everything is known at compile time (so it's kind of an enhanced-macro), why isn't the following syntax valid and I need the new return value syntax?

```
//WRONG    
template <typename Builder>
    decltype( builder.makeObject() )
    makeAndProcessObject (const Builder& builder)
    {
        auto val = builder.makeObject();
        // do stuff with val
        return val;
    }

```

**[bonus question - awards a +1 on the answer]**
3) In [this](https://stackoverflow.com/questions/15831470/return-value-syntax-and-template-not-working/15831536) question a guy asked why his code didn't compile and the answer was a missing "const" specifier to a member function makeObject. I got the answer but not why the const is required.

What gives to the following declaration

```
template <typename Builder>
auto
makeAndProcessObject (const Builder& builder) -> decltype( builder.makeObject() )

```

if a const Builder& object reference has a const makeObject or non-const makeObject? The decltype(builder.makeObject()) part must only find out what the return type of the function is, it shouldn't care if the function modifies or not the object passed as parameter!