Subject: Re: [boost] [multiprecision] Creation from a range
From: Fernando Pelliccioni (fpelliccioni_at_[hidden])
Date: 2016-01-06 11:10:07
On Tue, Jan 5, 2016 at 12:50 AM, Damian Vicino <damian.vicino_at_[hidden]>
> > Is there any way to create an Integer (or a number) from a range (bounded
> > or counted)?; or from a string_view (string_ref)?
> > Roughly speaking, something like:
> > XintXXX_t make_from_bounded_range(I f, I l);
> > XintXXX_t make_from_counted_range(I f, size_t n);
> What are the semantics?
I want to extract integers from a range (range of characters). Consider:
char buff = "12345 67890"; auto a =
make_from_bounded_range<int128_t>(buff, buff + 5); auto b =
make_from_counted_range<int128_t>(buff, 5); auto c =
make_from_bounded_range<int128_t>(buff + 6, buff + 6 + 5); auto d =
make_from_counted_range<int128_t>(buff + 6, 5); cout << a << '\n' << b <<
'\n' << c << '\n' << d << '\n';
How can I do this today with Boost multiprecision?
I don't want to copy characters to a temporal buffer.
> Is this a measure? Like an integer distance between borders?
I don't understand these questions. The numbers could be anything.
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk