出于某些原因,我必须重写我的git存储库的整个历史记录来更改每次提交的committer_id.但是,我附加了一个或多或少每个提交的注释,并使用git-filter-branch来更改committer_id将在逻辑上创建新的提交,留下注释.有没有办法将笔记复制到匹配的新提交中?
这个主题似乎提出了类似的问题,但在2011年没有解决方案.
谢谢您的帮助!
我试图在模板化结构中使用一些SFINAE.我将我的问题减少到以下,并可以使这项工作:
template<bool mybool>
struct test {
void myfunc();
};
template<bool mybool>
void test<mybool>::myfunc() {
std::cout << "test true" << std::endl;
}
template<>
void test<false>::myfunc() {
std::cout << "test false" << std::endl;
}
int main(int argc, char ** argv) {
test<true> foo;
test<false> bar;
foo.myfunc();
bar.myfunc();
}
Run Code Online (Sandbox Code Playgroud)
使用此代码,我得到结果:
test true
test false
Run Code Online (Sandbox Code Playgroud)
但是,如果我想考虑我struct test的多个模板参数,我尝试调整上面这样:
template<int myint, bool mybool>
struct test {
void myfunc();
};
template<int myint, bool mybool>
void test<myint,mybool>::myfunc() {
std::cout << "test true" << std::endl;
}
template<int …Run Code Online (Sandbox Code Playgroud)