Code Monkey home page Code Monkey logo

Comments (8)

yumetodo avatar yumetodo commented on May 21, 2024 1

つまりこのIssueは間違っていた・・・?(落ち着いて後で考える

from dungeontemplatelibrary.

yumetodo avatar yumetodo commented on May 21, 2024 1

そもそもこれデフォルトコンストラクタは自動生成されると思うのでいらないような気がしている。
一方でconstexpr BasicRect() = default; みたいに書いても問題はなさそうではある・・・

from dungeontemplatelibrary.

yumetodo avatar yumetodo commented on May 21, 2024

他にもあるかもしれんので再度確認されたほうがいいのではと

from dungeontemplatelibrary.

AsPJT avatar AsPJT commented on May 21, 2024

確認してみます。

from dungeontemplatelibrary.

AsPJT avatar AsPJT commented on May 21, 2024

デフォルトコンストラクタについている constexpr を全て削除しました。

それと、
#21 での指摘は constexpr の有無ではなく
noexcept の有無だと思います。

from dungeontemplatelibrary.

yumetodo avatar yumetodo commented on May 21, 2024

あれっ私間違ったこと言っている気がしてきたぞ・・・ちょっとまてよ・・・

from dungeontemplatelibrary.

yumetodo avatar yumetodo commented on May 21, 2024
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.

yumetodo avatar yumetodo commented on May 21, 2024

とりあえずstatic_assertでconstexprに構築できるかテストするべき

from dungeontemplatelibrary.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.