Skip to content

Simplify typeid SFINAE#12706

Closed
smessmer wants to merge 4 commits intoexport-D10184116from
export-D10400927
Closed

Simplify typeid SFINAE#12706
smessmer wants to merge 4 commits intoexport-D10184116from
export-D10400927

Conversation

@smessmer
Copy link
Contributor

@smessmer smessmer commented Oct 16, 2018

Stack:
    :white_circle:  #12307 Add TypeMeta::New/Delete  💚
    :black_circle:  #12706 [wip] Simplify typeid SFINAE  💛

If both branches are valid C++ code independent from the type passed in, then we can just use if/else inside of a constexpr function
to decide between the cases. Only if one branch would be invalid code (say because type T doesn't have a default constructor), we'd
need "constexpr if" or SFINAE.

Differential Revision: D10400927

Differential Revision: D10400927
Differential Version: 60767206
Differential Revision: D10400927
Differential Version: 60767408
Differential Revision: D10400927
Differential Version: 60767896
Differential Revision: D10400927
Differential Version: 60895750
@smessmer smessmer changed the title [wip] Simplify typeid SFINAE Simplify typeid SFINAE Oct 17, 2018
@smessmer smessmer requested review from dzhulgakov and ezyang October 19, 2018 21:23
Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

okey-dokey

zdevito pushed a commit to zdevito/ATen that referenced this pull request Oct 22, 2018
Summary:
Pull Request resolved: pytorch/pytorch#12706

If both branches are valid C++ code independent from the type passed in, then we can just use if/else inside of a constexpr function
to decide between the cases. Only if one branch would be invalid code (say because type T doesn't have a default constructor), we'd
need "constexpr if" or SFINAE.

Reviewed By: ezyang

Differential Revision: D10400927

fbshipit-source-id: 16d9855913af960b68ee406388d6b9021bfeb34a
@soumith soumith deleted the export-D10400927 branch February 21, 2019 23:24
@ezyang ezyang added the merged label Jun 25, 2019
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.

2 participants