Skip to content

fix: use std::move when passing by value in the config#555

Merged
wgtmac merged 1 commit into
apache:mainfrom
SYaoJun:fix_move
Feb 9, 2026
Merged

fix: use std::move when passing by value in the config#555
wgtmac merged 1 commit into
apache:mainfrom
SYaoJun:fix_move

Conversation

@SYaoJun

@SYaoJun SYaoJun commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Hi iceberg-cpp team, I found a clang-tidy warning on my environment.

@zhjwpku zhjwpku left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread requirements.txt Outdated
ninja==1.13.0
mkdocs==1.6.1
mkdocs-material==9.6.22
pre-commit==4.5.1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related?

@SYaoJun

SYaoJun commented Feb 6, 2026 via email

Copy link
Copy Markdown
Contributor Author

Comment thread src/iceberg/util/lazy.h Outdated
template <typename R, typename... Args>
struct Trait<R (*)(Args...)> {
using ReturnType = R::value_type;
using ReturnType = typename R::value_type;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a warning from clang-tidy? I guess that typename may be duplicate here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, clang-tidy suggest that. I think it is more straightforward if added.

@HuaHuaY HuaHuaY Feb 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to cppreference(https://en.cppreference.com/w/cpp/language/dependent_name.html), a dependent qualified name is assumed to name a type and no typename is required when a qualified name that appears in type-id, where the smallest enclosing type-id is the type-id in an alias declaration since C++20. Can you show the rule name when you meet clang-tidy warning?

@SYaoJun SYaoJun requested review from HuaHuaY and mapleFU February 9, 2026 01:49
@HuaHuaY

HuaHuaY commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

I approve the part of std::move and oppose the part of adding typename. If there is a clang-tidy warning, we can hide it in .clang-tidy.

@SYaoJun

SYaoJun commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

I approve the part of std::move and oppose the part of adding typename. If there is a clang-tidy warning, we can hide it in .clang-tidy.

Thanks for your time—I've updated the PR.

@wgtmac

wgtmac commented Feb 9, 2026

Copy link
Copy Markdown
Member

Thanks @SYaoJun for improving this! Perhaps you can create another PR to improve the pre-commit requirement config.

@wgtmac wgtmac changed the title fix: use std::move when pass by value fix: use std::move when passing by value in the config Feb 9, 2026
@wgtmac wgtmac merged commit 05b0f60 into apache:main Feb 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants