ddd install strclass.h error: friend declaration of ‘string common_prefix
ddd install strclass.h error: friend declaration of ‘string common_prefix
ddd version as following:
ddd-3.3.12.tar.gz
when do make ,compile error similar following
ddd install strclass.h error: friend declaration of ‘string common_prefix
diff --git i/ddd/strclass.h w/ddd/strclass.h
index 7ef16fa..faea640 100644
--- i/ddd/strclass.h
+++ w/ddd/strclass.h
@@ -810,10 +810,10 @@ public:
friend int split(const string& x, string *res, int maxn,
const regex& sep);
- friend string common_prefix(const string& x, const string& y,
- int startpos = 0);
- friend string common_suffix(const string& x, const string& y,
- int startpos = -1);
+ inline string common_prefix(const string& x, const string& y);
+ friend string common_prefix(const string& x, const string& y, int startpos);
+ inline string common_suffix(const string& x, const string& y);
+ friend string common_suffix(const string& x, const string& y, int startpos);
friend string replicate(char c, int n);
friend string replicate(const string& y, int n);
friend string join(const string *src, int n, const string& sep);
@@ -863,9 +863,10 @@ public:
friend inline std::ostream& operator<<(std::ostream& s, const subString& x);
friend std::istream& operator>>(std::istream& s, string& x);
- friend int readline(std::istream& s, string& x,
- char terminator = '\n',
- int discard_terminator = 1);
+ inline int readline(std::istream& s, string& x);
+ inline int readline(std::istream& s, string& x, char terminator);
+ friend int readline(std::istream& s, string& x, char terminator,
+ int discard_terminator);
// Status
unsigned int length() const;
@@ -1456,6 +1457,16 @@ inline string operator + (char x, const subString& y)
string r; cat(x, y, r); return r;
}
+inline string common_prefix(const string& x, const string& y)
+{
+ return common_prefix(x, y, 0);
+}
+
+inline string common_suffix(const string& x, const string& y)
+{
+ return common_suffix(x, y, -1);
+}
+
inline string reverse(const string& x)
{
string r; r.rep = string_Sreverse(x.rep, r.rep); return r;
@@ -1476,6 +1487,16 @@ inline string capitalize(const string& x)
string r; r.rep = string_Scapitalize(x.rep, r.rep); return r;
}
+inline int readline(std::istream& s, string& x)
+{
+ return readline(s, x, '\n', 1);
+}
+
+inline int readline(std::istream& s, string& x, char terminator)
+{
+ return readline(s, x, terminator, 1);
+}
+
// prepend
inline string& string::prepend(const string& y)
ddd install strclass.h error: friend declaration of ‘string common_prefix相关推荐
- mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’
编译FAAC-1.28时遇到错误: mpeg4ip.h:126: error: new declaration 'char* strcasestr(const char*, const char*)' ...
- 解决gcc报错:error: implicit declaration of function ‘inet_addr’ [-Werror=implicit-function-declaration]
此文首发于我的个人博客:解决gcc报错 error implicit declaration of function 'inet_addr' [-Werror=implicit-function-de ...
- error: invalid use of incomplete type 'XXXX' ;error: forward declaration of 'XXXX' 声明改为包含头文件
error: invalid use of incomplete type 'XXXX' error: forward declaration of XXXX 声明改为包含头文件 class XXXX ...
- IAR编译出现Error[Pe147]: declaration is incompatible with “__interwork __vfp int dir_get_dout()“ 报错
IAR编译出现Error[Pe147]: declaration is incompatible with "__interwork __vfp int dir_get_dout()&quo ...
- error: conflicting declaration ‘typedef struct LZ4_stream_t LZ4_stream_t’
问题描述: /usr/include/lz4.h:196:57: error: conflicting declaration 'typedef struct LZ4_stream_t LZ4_str ...
- 【已解决】error: conflicting declaration ‘typedef struct LZ4_stream_t LZ4_stream_t’ typedef struct { long
问题描述 error: conflicting declaration 'typedef struct LZ4_stream_t LZ4_stream_t' typedef struct { long ...
- error: expected declaration or statement at end of input
报警提示: error: expected declaration or statement at end of input 中文翻译:在输入的结尾处缺少应有的声明或语句 问题原因:缺少括号. 问题代 ...
- error: previous declaration of '****' was here
/home/dic/dic_dao.h:111: error: previous declaration of 'dic_get_organization_dao' was here make: ** ...
- C语言报错:error: static declaration of xxx follows non-static declaration
C语言报错:error: static declaration of xxx follows non-static declaration 报错原因 调用了静态函数,但没有声明 解决方案 在使用函数之 ...
最新文章
- Drop Down Menu
- java中的doget_java servlet中doGet()和doPost()方法的用法和区别
- ora-14400插入的分区关键字未映射到任何分区---oracle数据库表过期问题
- HDU - 4856 Tunnels(哈密顿路径+状压dp)
- 0.IDA-基本的反汇编算法
- 个人作业Alpha项目测试
- mysql字符集设置_mysql字符集设置
- 【Python】shutil内置模块复制和重命名文件
- JDBC基本知识总结概括及8个阶段优化过程:
- 服务端访问Linux的DNS出现DNS request timed out..
- 视频教程-三课时精通matlab拉普拉斯变换和逆变换-Matlab
- 元胞自动机-附代码注释
- CPU硅脂需要换吗?
- USB OTG(Host) 、 USB ADB(Device)、DWC3 Charge
- element date-picker range类型时间选择器 限制选中前后7天的时间的方法
- 根据药物名找华法林的代谢通路并可视化KGML文件
- 进程概念(PCB、进程创建、进程状态等)
- Vue3组合式Api script setup模式中顶层使用await报Top-level ‘await‘ expressions are only allowed when the ‘module‘
- MS17-010漏洞复现(x32)以及分析
- 【LM】360N4S解决手机关屏后经常无法唤醒的情况刷机第三方