Bug 864747 - Optional<T&> should be able to receive a value in the constructor. r=bz
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 24 Apr 2013 08:36:10 -0400
changeset 140692 1da0e5f7528f553fc7aab010fc6522aa031a57af
parent 140691 ea697909f4f29edec02e911294679b95d39529f7
child 140693 08ebffd7bc4d137dc97cddd2d55b184d21f59200
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs864747
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 864747 - Optional<T&> should be able to receive a value in the constructor. r=bz
dom/bindings/BindingDeclarations.h
--- a/dom/bindings/BindingDeclarations.h
+++ b/dom/bindings/BindingDeclarations.h
@@ -223,16 +223,21 @@ private:
 // Class for representing optional arguments.
 template<typename T>
 class Optional
 {
 public:
   Optional()
   {}
 
+  explicit Optional(const T& aValue)
+  {
+    mImpl.construct(aValue);
+  }
+
   bool WasPassed() const
   {
     return !mImpl.empty();
   }
 
   void Construct()
   {
     mImpl.construct();