When I write C ++ code, I try to use using <X> so as not to pollute too much. In Crypto ++, this gives me a problem in one case. The case is the ASN1 namespace in the CryptoPP namespace (it appears in only one place).
Here's the ad in Crypto ++: http://www.cryptopp.com/docs/ref/oids_8h_source.html .
I can use, for example, the secp256r1 curve with:
CryptoPP::ASN1::secp256r1();
However, I did not understand the way to declare it using. When I try:
#include <cryptopp/asn.h> #include <cryptopp/oids.h> using CryptoPP::ASN1;
As a result, it leads to error: namespace 'CryptoPP::ASN1' not allowed in using-declaration , and then error: 'ASN1' has not been declared in the following (I tried both of them):
ECIES<ECP>::Decryptor d1(prng, secp256r1()); ECIES<ECP>::Decryptor d2(prng, ASN1::secp256r1());
How to use using statement when more than one namespace exists?
$ g++ -version i686-apple-darwin11-llvm-g++-4.2
source share