mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-11 02:50:50 +00:00
ea84430864
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.
22 lines
437 B
C++
22 lines
437 B
C++
#include <Parsers/ASTAsterisk.h>
|
|
#include <IO/WriteBuffer.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
ASTPtr ASTAsterisk::clone() const
|
|
{
|
|
auto clone = std::make_shared<ASTAsterisk>(*this);
|
|
clone->cloneChildren();
|
|
return clone;
|
|
}
|
|
|
|
void ASTAsterisk::appendColumnName(WriteBuffer & ostr) const { ostr.write('*'); }
|
|
|
|
void ASTAsterisk::formatImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const
|
|
{
|
|
settings.ostr << "*";
|
|
}
|
|
|
|
}
|