Harden RippleCalc against dangling references (RIPD-500)

Intentionally including 2 independent commits:
* Wrap RippleCalc into a single function.
* Add enable_if_lvalue to beast library

I ended up rewroting `RippleCalc` work to be called via a single function, eliminating the issues with passing rvalues to the constructor, so the `enable_if_lvalue` check is not necessary. (The `RippleCalc` class still exists, but with a private constructor, and no path finding logic was changed.) However, because `enable_if_lvalue` will be useful next time we encounter a similar issue (or have any doubts), it is still available in the beast library.

Agree

2014-08-26 20:28 GMT+01:00, ximinez <notifications@github.com>:
>> +    the object will be freed as soon as the function returns. This could
>>
>> +    potentially lead to a variety of "use after free" errors.
>> +
>> +    If the function is rewritten as a template using this type, a
>> compiler
>> +    error will be generated if an rvalue is provided.
>> +
>> +    @code
>> +        // Example:
>> +        struct X
>> +        {
>> +        };
>> +        struct Y
>> +        {
>> +        };
>> +
>> +        struct UNSAFE
>
> Fixed and pushed.
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/ripple/rippled/pull/527/files#r16736220


-- 
Japroinovador