0
포인터 뒤에있는 값에 대한 참조를 원합니다.포인터 뒤의 값에 대한 참조
class UnicastCall {
protected:
std::fstream *m_stream_attachement_destination_;
...
public:
auto GetStreamAttachementDestination_AsPointer() -> decltype(m_stream_attachement_destination_)
{ return m_stream_attachement_destination_; } //THIS WORKS
auto GetStreamAttachementDestination_AsReference() -> decltype(*m_stream_attachement_destination_) &
{ return *m_stream_attachement_destination_; } //IS THIS CORRECT?
....
};
그러나 오류가 발생합니다.
error: use of deleted function 'std::basic_fstream<_CharT, _Traits>::basic_fstream(const std::basic_fstream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]'
auto fs = concrete_call->GetStreamAttachementDestination_AsReference();
좋은! 편집하고 일한다. –