
I have uploaded a new version to the Boost Vault. It is now a header only library. It can be downloaded (guid_v6.zip) at: http://www.boost-consulting.com/vault/ or direct download link: http://www.boost-consulting.com/vault/index.php? action=downloadfile&filename=guid_v6.zip&directory=& Andy Tompkins

Thanks a lot. I will test it right away. On 3/20/07, Andy <atompkins@fastmail.fm> wrote:
I have uploaded a new version to the Boost Vault.
It is now a header only library.
It can be downloaded (guid_v6.zip) at: http://www.boost-consulting.com/vault/
or direct download link: http://www.boost-consulting.com/vault/index.php? action=downloadfile&filename=guid_v6.zip&directory=&
Andy Tompkins
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Small thing I noticed in the implementation of template <typename ByteInputIterator> guid(ByteInputIterator first, ByteInputIterator last) { if (std::distance(first, last) != 16) { boost::throw_exception(std::invalid_argument("invalid input iterator pair, must span 16 bytes")); } data_type::iterator i_data = data_.begin(); while (first != last) { *i_data++ = numeric_cast<uint8_t>(*first++); } } You suggest that you want input iterators, and the invalid_argument message mentions input iterators, but your code doesn't work with input iterators as it traverses the range twice. It should probably ask for forward iterators or use something like template <typename ByteInputIterator> guid(ByteInputIterator first, ByteInputIterator last) { data_type::iterator i_data = data_.begin(); int i = 0; for (; i < 16 && first != last; ++i) { *i_data++ = numeric_cast<uint8_t>(*first++); } if ( i != 16 ) { boost::throw_exception(std::invalid_argument("invalid input iterator pair, must span at least 16 bytes")); } } ~ Scott McMurray On 3/20/07, Andy <atompkins@fastmail.fm> wrote:
I have uploaded a new version to the Boost Vault.
It is now a header only library.
It can be downloaded (guid_v6.zip) at: http://www.boost-consulting.com/vault/
or direct download link: http://www.boost-consulting.com/vault/index.php? action=downloadfile&filename=guid_v6.zip&directory=&
Andy Tompkins
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

me22 <me22.ca@gmail.com> wrote in news:fa28b9250703201126y574108d7r1c6f5f9d4584745a@mail.gmail.com:
Small thing I noticed in the implementation of template <typename ByteInputIterator> guid(ByteInputIterator first, ByteInputIterator last) { if (std::distance(first, last) != 16) { boost::throw_exception(std::invalid_argument("invalid input iterator pair, must span 16 bytes")); } data_type::iterator i_data = data_.begin(); while (first != last) { *i_data++ = numeric_cast<uint8_t>(*first++); } } You suggest that you want input iterators, and the invalid_argument message mentions input iterators, but your code doesn't work with input iterators as it traverses the range twice.
Good point! Thanks.
It should probably ask for forward iterators or use something like
template <typename ByteInputIterator> guid(ByteInputIterator first, ByteInputIterator last) { data_type::iterator i_data = data_.begin(); int i = 0; for (; i < 16 && first != last; ++i) { *i_data++ = numeric_cast<uint8_t>(*first++); } if ( i != 16 ) { boost::throw_exception(std::invalid_argument("invalid input iterator pair, must span at least 16 bytes")); } }
~ Scott McMurray
I will add this to my to do list. Andy. < snip >

I have uploaded a new version to the Boost Vault. It can be downloaded (guid_v7.zip) at: http://www.boost-consulting.com/vault/ or direct download link: http://www.boost-consulting.com/vault/index.php? action=downloadfile&filename=guid_v7.zip&directory=& It is the same as guid_v6.zip, but fixes a mixup in the create functions. The name-based one called the random-based one, and vise-versa. Andy Tompkins
participants (3)
-
Andy
-
Christian Henning
-
me22