我有一个简单的问题。我需要删除两个模式之间出现的所有情况。IE。
<INFOSTART
A=1
B=2
C=3
D=4
<INFOEND
<INFOSTART
G=1
Z=3
<INFOEND
Run Code Online (Sandbox Code Playgroud)
所以我希望输出如下
A=1 B=2 C=3 D=4
G=1 Z=3
Run Code Online (Sandbox Code Playgroud)
知道我该怎么做吗?并提前感谢大家..
我有一点麻烦了解如何通过这个以被传递到库的回调函数。该功能需要具有特定的签名。
有问题的库是OCILIB(https://vrogier.github.io/ocilib/doc/html/classocilib_1_1_subscription.html),并尝试将类函数作为Register()的第4个参数传递。
我可以顺利通过以下
&database::callback // a static function of database
Run Code Online (Sandbox Code Playgroud)
要么
[](ocilib::Event &event) // as lambda function
{
}
Run Code Online (Sandbox Code Playgroud)
但它无权访问实例变量。我试图像
[&](ocilib::Event &event) // as lambda function
{
}
Run Code Online (Sandbox Code Playgroud)
但签名不匹配,出现以下错误
database.cpp: In member function ‘bool dcn::database::watch(std::__cxx11::string)’:
database.cpp:104:44: error: no matching function for call to ‘ocilib::Subscription::Register(ocilib::Connection&, std::__cxx11::string&, ocilib::Subscription::ChangeTypesValues, dcn::database::watch(std::__cxx11::string)::<lambda(ocilib::Event&)>, unsigned int, unsigned int)’
}, (unsigned int) 7778, (unsigned int) 0);
^
In file included from /usr/include/ocilib.hpp:9194:0,
from /home/ai/dcn/include/main.h:17,
from database.cpp:1:
/usr/include/ocilib_impl.hpp:6650:13: note: candidate: void ocilib::Subscription::Register(const ocilib::Connection&, const ostring&, …Run Code Online (Sandbox Code Playgroud)