Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit the implementation of typename: more customizable and stable. #472

Merged
merged 6 commits into from
Aug 31, 2021

Conversation

sighingnow
Copy link
Member

What do these changes do?

Revisit the vineyard::type_name implementation to make it more composable and stable when acrossing platforms. e.g., std::string will be always std::string no matter on which platform, and int64_t will be always "int64", rather than "long", or "long long" on different platforms.

Users can supply their own typename for customized type, e.g.,

struct XX {
};

namespace vineyard {

template <>
inline const std::string type_name() {
    return "XX-name";
}
}

Related issue number

Fixes #457

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
@codecov
Copy link

codecov bot commented Aug 31, 2021

Codecov Report

Merging #472 (9dfcd93) into main (9aed745) will increase coverage by 0.13%.
The diff coverage is 88.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #472      +/-   ##
==========================================
+ Coverage   70.03%   70.16%   +0.13%     
==========================================
  Files          63       63              
  Lines        5589     5614      +25     
==========================================
+ Hits         3914     3939      +25     
  Misses       1675     1675              
Impacted Files Coverage Δ
src/common/util/typename.h 88.00% <88.00%> (+88.00%) ⬆️
src/server/async/socket_server.cc 70.51% <0.00%> (+0.49%) ⬆️

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
@sighingnow sighingnow merged commit 3a8fb19 into v6d-io:main Aug 31, 2021
@sighingnow sighingnow deleted the ht/typename-composable branch August 31, 2021 11:23
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.

vineyard::type_name<T> is not stable
1 participant