g++ error: expected nested-name-specifier before 'XXX'


 1 template <typename addrT=int,typename valuT=int,typename stream_addrT=bm_addr,typename stream_sizeT=int64> 
 2 class  stream_chip : public chip<addrT,valuT>{ 
 3 public: 
 4     typedef  typename stream_addrT stream_addr_type; 
 5     typedef  typename stream_sizeT stream_size_type; 
 6  
 7     stream_chip (bus_type * const owner, addr_type addr):chip<addrT,valuT>(owner,addr) 
 8     {} 
 9 public: 
10     virtual stream_size_type write_mem(stream_addr_type dest_addr, void* pValue ,stream_size_type size)=0;  //write board memory 
11     virtual stream_size_type read_mem(void* pValue,stream_size_type size ,stream_addr_type src_addr)=0;        //read bpard memory     
12  
13 };

 


明明全部代碼都在VS編譯下好好的

把以上public的typename刪除就行了。錯誤就不報了。唉,移植就是ISO標准問題多。各平台的擴展實現也亂七八糟。

references:
http://bbs.csdn.net/topics/370075224
http://stackoverflow.com/questions/5249835/expected-nested-name-specifier-before-const-error-with-typename-const-in-g




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM