[CppAD] operator>>( istream , AD<double> )
Norman Goldstein
normvcr at telus.net
Sun Dec 30 17:11:15 EST 2012
I would find it convenient to write code like:
#include <iostream>
CppAD::AD<double> x;
std::cin >> x;
but I get the error
//============ Error from compilier ====================
tcppad.cpp:70:14: error: cannot bind ‘std::istream {aka
std::basic_istream<char>}’ lvalue to ‘std::basic_istream<char>&&’
In file included from
/usr/lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/iostream:41:0,
from /home/work/SRC/source/SVN_src/dev/src/test/tcppad.cpp:1:
/usr/lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/istream:866:5:
error: initializing argument 1 of ‘std::basic_istream<_CharT, _Traits>&
std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with
_CharT = char; _Traits = std::char_traits<char>; _Tp = CppAD::AD<double>]’
//==============================================
Is there a header I should be using? Or is this code not a good idea?
I am using
g++ -std=c++0x ...
on Fedora 17, 32-bit, x86
Thank you.
More information about the CppAD
mailing list