kwiberg d040480f69 rtc::Optional<T>: Don't secretly contain a default-constructed T when empty
Instead, use a neat trick with union to ensure that we have a T only
when we're supposed to (and just a bunch of unused memory otherwise).
This is how std::optional behaves, so it makes sense for us to do the
same (and it's convenient, too, since we don't have to pay for the
default-constructed T, and we support types that don't have default
constructors).

Doing this became possible recently when we dropped support for MSVC
2013, which didn't support unions containing non-trivial types.

Review-Url: https://codereview.webrtc.org/1896833004
Cr-Commit-Position: refs/heads/master@{#12664}
2016-05-09 13:06:10 +00:00
..
2015-09-24 13:07:04 +00:00
2015-09-24 13:07:04 +00:00
2015-04-02 10:31:00 +00:00
2015-06-10 18:33:24 +00:00
2015-12-28 22:07:05 +00:00
2015-12-28 22:07:05 +00:00
2015-05-21 11:50:41 +00:00
2015-05-21 11:50:41 +00:00
2015-04-01 22:25:29 +00:00
2016-02-02 16:34:16 +00:00
2016-04-28 12:14:30 +00:00
2015-11-26 16:45:57 +00:00
2015-11-26 16:45:57 +00:00
2015-09-22 18:58:13 +00:00
2016-04-28 12:14:30 +00:00
2016-04-28 12:14:30 +00:00
2016-01-04 21:44:16 +00:00
2016-01-14 19:01:25 +00:00