Giter Club home page Giter Club logo

cpp_interview's Issues

String类的移动构造函数

String::String(const String &&other)    // 得分点:输入参数为const型
{
m_data = other.data;
other.data = nullptr;
}
大佬大佬,这里other是不是有误,应该不能是const类型吧

关于#define宏常量和const常量的区别 第四点

在第四点中
是否可以做函数参数
宏定义不能作为参数传递给函数
const常量可以在函数的参数列表中出现

我觉得宏定义是可以作为参数传递给函数,宏只是一个简单的替换,也是可以放在函数参数中,无论是实际参数传递还是作为形参部分都是可以的

常考代码部分无法查看

你好,今天在搜索c++八股的repo看到这个,很详尽!不过我看repo里常考代码部分没办法查看了

线程池销毁线程函数

大佬,线程池销毁线程这里
void Thread_pool::destory_thread(){
pthread_t tid = pthread_self();
for(int i = 0; i < m_max_num; i++){
if(thread_compose[i] == tid){
std::cout << "threadExit() function: thread "
<< std::to_string(pthread_self()) << " exiting..." << std::endl;
}
thread_compose[i] = 0;
break;
}
pthread_exit(nullptr);
}
的thread_compose[i] = 0;
break;
是不是应该放在if判断里面呀

差两张图片

C++智能指针章节八股文,make_shared方法里面差两张图片无法加载哟

手撕代码双向链表实现LRU里的show函数

void LRUCache::show(){
//链表中没有节点,退出
if(head_node->next = head_node){
return;
}
Node* tmp = head_node->next;
while(tmp->next != head_node){
std::cout<<"key:"<key<<",vlaue:"<value<<std::endl;
}
}

这里的while循环是不是有点问题啊,条件应该是tmp!=head_node,里面应该加一句tmp=tmp->next?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.