make Range::size() constexpr
authorAdam Simpkins <simpkins@fb.com>
Wed, 8 Jun 2016 23:15:18 +0000 (16:15 -0700)
committerFacebook Github Bot 6 <facebook-github-bot-6-bot@fb.com>
Wed, 8 Jun 2016 23:23:22 +0000 (16:23 -0700)
commit8cb615a27594078056b2e4ec2350660e594f5a89
tree57fec73f8d0d352b9e1e77906b98a273f30d1be1
parent67a55881d21e8359640c86a0486de2f0da44390f
make Range::size() constexpr

Summary:
Declare size() to return a constexpr value, so it can be called on constexpr
Range objects.

This unfortunately does drop the existing assert() check, due to a gcc bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71448

Reviewed By: lbrandy

Differential Revision: D3394612

fbshipit-source-id: 77ea3b961dc323a39dea6f0e5850f9a311210d09
folly/Range.h
folly/test/RangeTest.cpp