In software engineering, the delegation pattern is an object-oriented design pattern that allows object composition to achieve the same code reuse as inheritance. In delegation, an object handles a request by delegating to a second object (the delegate). The delegate is a helper object, but with the original context. With language-level support for delegation, this is done implicitly by having sel
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com. This article describes C++11/14/17 features in Visual C++. C++11Feature List Visual C++ implements the vast majority of features in the C++11 core language specification, as well as many C++14 Library features and some features proposed for C++17. The following table lists C++11/14/17 core langu
As promised, we’re back with more design discussion and hopefully some interesting ideas. Let’s start with a quick recap of what has happened so far. First, Sandi Metz posted on her blog about type specific coupling that a case statement can introduce. Her proposed solution encouraged us to pass the responsibilities down to the individual objects, which is certainly desirable. Aaron Patterson got
ha = {foo: "hoge"} ha2 = ha.dup ha2[:foo].reverse! #=> "egoh" ha #=> {:foo=>"egoh"} class AnzenHash < Hash def [](key) immutable?(value = super) ? value : value.dup end undef []= private def immutable?(value) value.frozen? || [Fixnum, Symbol, TrueClass, FalseClass, NilClass].any?{|k| value.is_a? k } end end ha = {foo: "hoge"} ha2 = AnzenHash[ha] ha2[:foo] #=> "hoge" ha2[:foo].reverse! #=> "egoh" h
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く