template <typename ContainerType>
ContainerType rsa_encrypt_list(const std::string&, const typename
ContainerType::reference, const typename ContainerType::reference);
const BigInteger e(boost::lexical_cast<BigInteger>(rsa_encrypts[2]));
const BigInteger
n(boost::lexical_cast<BigInteger>(rsa_encrypts[1]));
std::string infile(rsa_encrypts[0]);
boost::scoped_ptr<boost::filesystem::ifstream> encrypt_input(new
boost::filesystem::ifstream(infile));
const std::string
plaintext(std::istreambuf_iterator<char>(encrypt_input->rdbuf()),
std::istreambuf_iterator<char>());
std::list<BigInteger>
decrypted_list(encryptcpw::rsa_encrypt_list<std::list<BigInteger>
(plaintext, e, n)); // this is line 64.
std::vector<BigInteger>(ciphertext).swap(ciphertext);
// ... some code in between.
const std::string answer(encryptcpw::rsa_decrypt_list(ciphertext, d,
n)); // this is line 102.
error on gcc:
./cs512/c++/RsaEncrypt.cpp:64: error: no matching function for call to
'rsa_encr
ypt_list(const std::string&, const BigInteger&, const BigInteger&)'
./cs512/c++/RsaEncrypt.cpp:102: error: no matching function for call
to 'rsa_dec
rypt_list(std::vector<BigInteger, std::allocator<BigInteger> >&, const
BigIntege
r&, const BigInteger&)'
error on msvc:
./cs512/c++/RsaEncrypt.cpp(64) : error C2664:
'encryptcpw::rsa_encrypt_list' : cannot convert parameter 2 from
'const BigInteger' to 'BigInteger &'
Conversion loses qualifiers
Anybody know how to fix this.
.. you can't const-qualify ContainerType::reference; Comeau online