chronolaw / cpp_study Goto Github PK
View Code? Open in Web Editor NEWfollow me to study modern c++
License: BSD 2-Clause "Simplified" License
follow me to study modern c++
License: BSD 2-Clause "Simplified" License
cpp_study/section5/SpinLock.hpp
Line 45 in 316e0bd
搜索了下ATOMIC_FLAG_INIT,c++20后这个宏被废弃,20前在使用,若标志拥有静态存储期,则此初始化为静态。老师能否帮忙解释下?
https://zh.cppreference.com/w/cpp/atomic/ATOMIC_FLAG_INIT
选择排序select_sort中元素交换应该是在确定最小元素即内层循环结束后,再进行交换,望博主查明
CPP_DEPRECATED
currency_type average() const
{
return m_revenue / m_sold;
}
老师为什么这个函数要设置为deprecated属性啊?
While trying to provide the makefile for example code under section2, I found some code are at least require c++14 standard, do you propose to support all code support c++11?
currently below examples under section2 need c++14:
error: use of undeclared identifier '__GLIBCXX__'
cout << "libstdc++ = " << __GLIBCXX__ << endl;
^
1 error generated.
Line 99 in 316e0bd
输出:
i
x = 10 x1= 10
[root c++]#c++filt -t i
int
这里c++filt -t视乎不能正确处理引用类型?
// static_assert
#if __cpp_static_assert >= 201411
# define STATIC_ASSERT(x) static_assert(x)
#else
# define STATIC_ASSERT(x) static_assert(x, #x)
#endif
这里为啥判断c++14?参考cppreference只有c++11和c++17有过改动,一个带提示信息,一个不带提示信息
g++ test.cpp -std=c++14 -I../common -o a.out;./a.out
老师, 这个 -I../common 表示什么编译指令呀?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.