Comments (8)
つまりこのIssueは間違っていた・・・?(落ち着いて後で考える
from dungeontemplatelibrary.
そもそもこれデフォルトコンストラクタは自動生成されると思うのでいらないような気がしている。
一方でconstexpr BasicRect() = default;
みたいに書いても問題はなさそうではある・・・
from dungeontemplatelibrary.
他にもあるかもしれんので再度確認されたほうがいいのではと
from dungeontemplatelibrary.
確認してみます。
from dungeontemplatelibrary.
デフォルトコンストラクタについている constexpr
を全て削除しました。
それと、
#21 での指摘は constexpr
の有無ではなく
noexcept
の有無だと思います。
from dungeontemplatelibrary.
あれっ私間違ったこと言っている気がしてきたぞ・・・ちょっとまてよ・・・
from dungeontemplatelibrary.
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index 209f395..d920a7d 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -250,7 +250,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
// 20.11.5.1 construction / copy / destroy
constexpr duration() = default;
- constexpr duration(const duration&) = default;
+ // NB: Make constexpr implicit. This cannot be explicitly
+ // constexpr, as any UDT that is not a literal type with a
+ // constexpr copy constructor will be ill-formed.
+ duration(const duration&) = default;
template<typename _Rep2, typename = typename
enable_if<is_convertible<_Rep2, rep>::value
https://gcc.gnu.org/ml/libstdc++/2012-10/msg00120.html
これがどういう意味かさっぱり理解出来ないです。そもそもUDT #とはhttps://t.co/2oykOFuxda#constexpr #cpp @bolero_MURAKAMI @_EnumHack pic.twitter.com/Z4sgBtbvor
— yumetodo-鳥の氷河から逃げる (@yumetodo) 2016年3月14日
@yumetodo つまり、duration<Rep> の Rep は非リテラル型なユーザ定義型である可能性があるため、明示的にconstexpr指定しないようにする変更。Rep がリテラル型である場合、トリビアルコピーコンストラクタは暗黙にconstexpr指定される。
— 狂える中3女子ボレロ村上/陶芸C++er (@bolero_MURAKAMI) 2016年3月14日
@bolero_MURAKAMI >トリビアルコピーコンストラクタは暗黙にconstexpr指定される。
— yumetodo-鳥の氷河から逃げる (@yumetodo) 2016年3月14日
今日まで気がついてなかった・・・。
ありがとうございます。
@yumetodo 直訳:暗黙にconstexpr指定される。非リテラル型な任意のUDT(User-Defined Type)に対して、constexprコピーコンストラクタはill-formedになるため、明示的にconstexpr指定すべきでない。
— 狂える中3女子ボレロ村上/陶芸C++er (@bolero_MURAKAMI) 2016年3月14日
これが背景
from dungeontemplatelibrary.
とりあえずstatic_assert
でconstexprに構築できるかテストするべき
from dungeontemplatelibrary.
Related Issues (13)
- nodiscard属性のプリプロセス時分岐をマクロとしてまとめるべき HOT 7
- サポートされる Matrix の形について HOT 2
- CMake対応 HOT 13
- Dungeon/ImageWrite.hppとは? HOT 2
- dtl::storage::FileMD: 書き出しファイルの拡張子はtxtではなくmdであるべきではないか? HOT 2
- CIを有効にする HOT 14
- 非リテラル型な任意のUDT(User-Defined Type)に対して、constexprコピーコンストラクタはill-formedになる HOT 10
- 開発ブランチとリリースブランチを分けてほしい HOT 1
- Unused parameterがたくさんある HOT 11
- 複数の翻訳単位からインクルードすると未定義動作となる HOT 10
- 使用されている乱数エンジンに seed sequence を渡せない HOT 2
- circle CIでのビルド/テストにcmakeが利用されていないのはなぜなのか? HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dungeontemplatelibrary.