Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #10635 > unrolled thread

does boost::crc_32_type generate an exception?

Started by"A" <a@a.a>
First post2011-10-02 18:50 +0200
Last post2011-10-06 09:08 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.lang.c++


Contents

  does boost::crc_32_type generate an exception? "A" <a@a.a> - 2011-10-02 18:50 +0200
    Re: does boost::crc_32_type generate an exception? "A" <a@a.a> - 2011-10-04 15:31 +0200
      Re: does boost::crc_32_type generate an exception? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-10-06 09:08 +0000

#10635 — does boost::crc_32_type generate an exception?

From"A" <a@a.a>
Date2011-10-02 18:50 +0200
Subjectdoes boost::crc_32_type generate an exception?
Message-ID<j6a4ob$jvf$1@gregory.bnet.hr>
Can this code generate an exception under some circumstances?

unsigned CRC32(const void *Buffer, unsigned BufferLength)
{
boost::crc_32_type result;
result.process_bytes(Buffer, BufferLength);
return result.checksum();
}

I've seen the example at 
http://www.boost.org/doc/libs/1_37_0/libs/crc/crc_example.cpp
but that doesn't tell me if it generates exceptions for crc_32_type alone... 

[toc] | [next] | [standalone]


#10658

From"A" <a@a.a>
Date2011-10-04 15:31 +0200
Message-ID<j6f1qv$efd$1@gregory.bnet.hr>
In reply to#10635
a reply to myself... it seems that crc.hpp doesn't have any throw in it so I 
guess it doesn't generate any exceptions. problem solved :) 

[toc] | [prev] | [next] | [standalone]


#10693

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2011-10-06 09:08 +0000
Message-ID<slrnj8qrvp.1bk.grahn+nntp@frailea.sa.invalid>
In reply to#10658
On Tue, 2011-10-04, A wrote:
> a reply to myself...

OK, but please quote yourself next time to give some context.

> it seems that crc.hpp doesn't have any throw in it so I 
> guess it doesn't generate any exceptions. problem solved :) 

Have you checked so it doesn't call anything which can throw, either?

I had a quick look earlier ... their example indeed catches
exceptions, but only as std::exception and '...'. I get the feeling
it's due to some overall rule like "never let exception escape
main()".

The author should really have documented this. Perhaps he assumed
everyone knew how CRC calculation are performed ...

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web