ClickHouse/dbms/src/Parsers/ASTQualifiedAsterisk.h
Amos Bird ea84430864 Get rid of useless std::move to get NRVO
http://eel.is/c++draft/class.copy.elision#:constructor,copy,elision

Some quote:

> Speaking of RVO, return std::move(w); prohibits it. It means "use move constructor or fail to compile", whereas return w; means "use RVO, and if you can't, use move constructor, and if you can't, use copy constructor, and if you can't, fail to compile."

There is one exception to this rule:
```cpp
Block FilterBlockInputStream::removeFilterIfNeed(Block && block)
{
    if (block && remove_filter)
        block.erase(static_cast<size_t>(filter_column));

    return std::move(block);
}
```

because references are not eligible for NRVO, which is another rule "always move rvalue references and forward universal references" that takes precedence.
2018-08-27 22:15:48 +08:00

29 lines
622 B
C++

#pragma once
#include <Parsers/IAST.h>
namespace DB
{
/** Something like t.*
* It will have qualifier as its child ASTIdentifier.
*/
class ASTQualifiedAsterisk : public IAST
{
public:
String getID() const override { return "QualifiedAsterisk"; }
ASTPtr clone() const override
{
auto clone = std::make_shared<ASTQualifiedAsterisk>(*this);
clone->cloneChildren();
return clone;
}
void appendColumnName(WriteBuffer & ostr) const override;
protected:
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
};
}