Trip Report: June 2008 ISO C++ Standards Meeting

我的个人目标 目标明确:三年内考取系统架构师、系统分析师、项目管理师、软件评测师,提升沟通与挂靠能力,拓展人脉。计划云游北京、上海等地,同时在多家公司担任架构师与讲师,以广见闻、强团队。团队按六类角色分工,聚焦VC外包与微型端游,通过游戏《程序员养成计划》培训新人、降低入行风险。重构《智勇三国》为新项目奠基,强调文档与可维护性。坚持“专业人做专业事”,以技术实力与持续输出赢得认可。 阅读详情

原文:http://herbsutter.wordpress.com/2008/07/04/trip-report-june-2008-iso-c-standards-meeting/ 

 

The ISO C++ committee met in Sophia Antipolis, France on June 6-14. You can find the minutes here (note that these cover only the whole-group sessions, not the breakout technical sessions where we spend most of the week).

Here’s a summary of what we did, with links to the relevant papers to read for more details, and information about upcoming meetings.

Highlights: Complete C++0x draft coming in September

The biggest goal entering this meeting was to make C++0x feature-complete and stay on track to publish a complete public draft of C++0x this September for international review and comment — in ISO-speak, an official Committee Draft or CD. We are going to achieve that, so the world will know the shape of C++0x in good detail this fall.

We’re also now planning to have two rounds of international comment review instead of just one, to give the world a good look at the standard and two opportunities for national bodies to give their comments, the first round starting after our September 2008 meeting and the second round probably a year later. However, the September 2008 CD is “it”, feature-complete C++0x. The only changes expected to be made between that CD and the final International Standard are bug fixes and clarifications. It’s helpful to think of a CD as a feature-complete beta.

Coming into the June meeting, we already had a nearly-complete C++0x internal working draft — most features that will be part of C++0x had already been “checked in.” Only a few were still waiting to become stable enough to vote in, including initializer lists, range-based for loops, and concepts.

Of these, concepts is the long-pole feature for C++0x, which isn’t surprising given that it’s the biggest new language feature we’re adding to Standard C++. A primary goal of the June meeting, therefore, was to make as much progress on concepts as possible, and to see if it would be possible to vote that feature into the C++0x working draft at this meeting. We almost did that, thanks to a lot of work not only in France but also at smaller meetings throughout the winter and spring: For the first time, we ended a meeting with no known issues or controversial points in the concepts standardese wording, and we expect to “check in” concepts into the working draft at the next meeting in September, which both cleared the way for us to publish a complete draft then and motivated the plan to do two rounds of public review rather than one, just to make sure the standard got enough “bake time” in its complete form.

Next, I’ll summarize some of the major features voted into the draft at the June meeting.

Initializer lists

C++0x initializer lists accomplish two main objectives:

  • Uniformity: They provide a uniform initialization syntax you can use consistently everywhere, which is especially helpful when you write templates.
  • Convenience: They provide a general-purpose way of using the C initializer syntax for all sorts of types, notably containers.

See N2215 for more on the motivation and original design, and N2672 and N2679 for the final standardese.

Example: Initializing aggregates vs. classes

It’s convenient that we can initialize aggregates like this:

struct Coordinate1 {
  int i;
  int j;
  //…
};

Coordinate1 c1 = { 1, 2 };

but the syntax is slightly different for classes with constructors:

class Coordinate2 {
public:
  Coordinate2( int i, int j );
  // …
};

Coordinate2 c2( 1, 2 );

In C++0x, you can still do all of the above, but initializer lists give us a regular way to initialize all kinds of types:

Coordinate1 c1 = { 1, 2 };
Coordinate2 c2 = { 1, 2 }; // legal in C++0x

Having a uniform initialization syntax is particularly helpful when writing template code, so that the template can easily work with a wide variety of types.

Example: Initializing arrays vs. containers

One place where the lack of uniform initialization has been particularly annoying — at least to me, when I write test harnesses to exercise the code I show in articles and talks — is when initializing a container with some default values. Don’t you hate it when you want to create a container initialized to some known values, and if it were an array you can just write:

string a[] = { “xyzzy”, “plugh”, “abracadabra” };

but if it’s a container like a vector, you have to default-construct the container and then push every entry onto it individually:

// Initialize by hand today
vector<string> v;
v.push_back( “xyzzy” );
v.push_back( “plugh” );
v.push_back( “abracadabra” );

or, even more embarrassingly, initialize an array first for convenience and then construct the vector as a copy of the array, using the vector constructor that takes a range as an iterator pair:

// Initialize via an array today
string a[] = { “xyzzy”, “plugh”, “abracadabra” }; // put it into an array first
vector<string> v( a, a+3 ); // then construct the vector as a copy

Arrays are weaker than containers in nearly every other way, so it’s annoying that they get this unique convenience just because of their having been built into the language since the early days of C.

The lack of convenient initialization has been even more irritating with maps:

// Initialize by hand today
map<string,string> phonebook;
phonebook[ "Bjarne Stroustrup (cell)" ] = “+1 (212) 555-1212″;
phonebook[ "Tom Petty (home)" ] = “+1 (858) 555-9734″;
phonebook[ "Amy Winehouse (agent)" ] = “+44 20 74851424″;

In C++0x, we can initialize any container with known values as conveniently as arrays:

// Can use initializer list in C++0x
vector<string> v = { “xyzzy”, “plugh”, “abracadabra” };
map<string,string> phonebook =
  { { “Bjarne Stroustrup (cell)”, “+1 (212) 555-1212″ },
    { “Tom Petty (home)”, “+1 (858) 555-9734″ },
    { “Amy Winehouse (agent)”, “+44 99 74855424″ } };

As a bonus, a uniform initialization syntax even makes arrays easier to deal with. For example, the array initializer syntax didn’t support arrays that are dynamically allocated or class members arrays:

// Initialize dynamically allocated array by hand today
int* a = new int[3];
a[0] = 1;
a[1] = 2;
a[2] = 99;

// Initialize member array by hand today
class X {
  int a[3];
public:
  X() { a[0] = 1; a[1] = 2; a[2] = 99; }
};

In C++0x, the array initialization syntax is uniformly available in these cases too:

// C++0x

int* a = new int[3] { 1, 2, 99 };

class X {
  int a[3];
public:
  X() : a{ 1, 2, 99 } {}
};

More concurrency support

Last October, we already voted in a state-of-the-art memory model, atomic operations, and a threading package. That covered the major things we wanted to see in this standard, but a few more were still in progress. Here are the major changes we made this time that relate to concurrency.

Thread-local storage (N2659): To declare a variable which will be instantiated once for each thread, use the thread_local storage class. For example:

class MyClass {
  …
private:
  thread_local X tlsX;
};
void SomeFunc() {
  thread_local Y tlsY;
  …
};

Dynamic initialization and destruction with concurrency (N2660) handles two major cases:

  • Static and global variables can be concurrently initialized and destroyed if you try to access them on multiple threads before main() begins. If more than one thread could initialize (or use) the variable concurrency, however, it’s up to you to synchronize access.
  • Function-local static variables will have their initialization automatically protected; while one thread is initializing the variable, any other threads that enter the function and reach the variable’s declaration will wait for the initialization to complete before they continue on. Therefore you don’t need to guard initialization races or initialization-use races, and if the variable is immutable once constructed then you don’t need to do any synchronization at all to use it safely. If the variable can be written to after construction, you do still need to make sure you synchronize those post-initialization use-use races on the variable.

Thread safety guarantees for the standard library (N2669): The upshot is that the answer to questions like “what do I need to do to use a vector<T> v or a shared_ptr<U> sp thread-safely?” is now explicitly “same as any other object: if you know that an object like v or sp is shared, you must synchronize access to it.” Only a very few objects need to guarantee internal synchronization; the global allocator is one of those, though, and so it gets that stronger guarantee.

The “other features” section below also includes a few smaller concurrency-related items.

More STL algorithms (N2666)

We now have the following new STL algorithms. Some of them fill holes (e.g., “why isn’t there a copy_if or a counted version of algorithm X?”) and others provide handy extensions (e.g., “why isn’t there an all_of or any_of?”).

  • all_of( first, last, pred )
    returns true iff all elements in the range satisfy pred
  • any_of( first, last, pred )
    returns true iff any element in the range satisfies pred
  • copy_if( first, last result, pred)
    the “why isn’t this in the standard?” poster child algorithm
  • copy_n( first, n result)
    copy for a known number of n elements
  • find_if_not( first, last, pred )
    returns an iterator to the first element that does not satisfy pred
  • iota( first, last, value )
    for each element in the range, assigns value and increments value “as if by ++value”
  • is_partitioned( first, last, pred )
    returns true iff the range is already partitioned by pred; that is, all elements that satisfy pred appear before those that don’t
  • none_of( first, last, pred )
    returns true iff none of the elements in the range satisfies pred
  • partition_copy( first, last, out_true, out_false, pred )
    copy the elements that satisfy pred to out_true, the others to out_false
  • partition_point( first, last, pred)
    assuming the range is already partitioned by pred (see is_partitioned above), returns an iterator to the first element that doesn’t satisfy pred
  • uninitialized_copy_n( first, n, result )
    uninitialized_copy for a known number of n elements

Other approved features

  • N2435 Explicit bool for smart pointers
  • N2514 Implicit conversion operators for atomics
  • N2657 Local and unnamed types as template arguments
  • N2658 Constness of lambda functions
  • N2667 Reserved namespaces for POSIX
  • N2670 Minimal support for garbage collection and reachability-based leak detection 
  • N2661 Time and duration support
  • N2674 shared_ptr atomic access
  • N2678 Error handling specification for Chapter 30 (Threads)
  • N2680 Placement insert for standard containers

Next Meeting

Although we just got back from France, the next meeting of the ISO C++ standards committee is already coming up fast:

The meetings are public, and if you’re in the area please feel free to drop by.

如何在不牺牲精度的前提下,把 YOLOv11 压缩到 Jetson 能跑的程度 YOLOv11 在目标检测任务中具备较强的准确性与多尺度鲁棒性,但其原始模型参数规模与计算量,对边缘设备来说并不友好,特别是面向 Jetson 这类资源受限的推理平台。本文基于实际部署场景,逐步拆解从结构层级改造、剪枝策略制定、量化导出流程,到 Jetson TensorRT 推理落地全过程。在不牺牲主干精度的前提下,最终实现 YOLOv11 推理延迟缩短 3 倍、模型体积压缩 4 倍、mAP 损失控制在 1% 以内的轻量化优化结果,并总结出一条可复用的工程路径,供工业界与边缘侧模型部署开发者参考。 阅读详情

相关推荐

避坑指南:ShardingSphere连接达梦/金仓数据库时SQL解析器的那些‘坑‘

本文深入探讨了ShardingSphere与国产数据库(如达梦、金仓)集成时遇到的SQL解析器差异问题,提供了详细的解决方案和优化策略。通过分析SQL方言差异、JDBC实现差异及解析器兼容性,帮助开发者有效避坑,提升分布式数据库架构设计的效率与稳定性。

weixin_29309475的博客 399

插上了还不算:线束连接器插接的腔位图锁定、错腔防呆、端子回拉确认、TPA/CPA 二次锁止与插接追溯 MES 闸门

端子插进护套、导通测通了,不等于已经锁住。本文讲连接器插接工位的五道 MES 闸门:腔位图版本锁定、扫线亮灯与错腔拦截、逐腔回拉确认、盲堵与 TPA/CPA 二次锁止检测,以及退针计数与按 SN×护套×腔位追溯,力值和限值均为示例。

小杉杉的博客 359

SAP ERPsim生产拓展实验报告

ERP课的实验和实践,也是SAP竞赛玩的东西,除了界面不华丽外很像游戏而且是团队型的pvp大乱斗

m0_67262022的博客 2028

从 string 到 STL,再到 MFC 上

两题合计把 string 的核心接口过了一遍:构造与迭代器、rbegin()/rend()、compare()、length()、erase()、cctype 中的 isalpha()/tolower(),以及 getline() 与 cin >> 的输入差异。题目真正考察的是 vector<string> 的填充、打开与读取循环、srand(time(0)) 与 rand() 的配合,以及 string::find() 的「从指定位置继续查找」用法。反转构造用 rbegin()/rend()。

XLYcmy的博客 400

从原理到接法全面了解三相电

从原理到接法全面了解三相电

viixin的博客 1万+

全国职业技能大赛网络安全-金砖技能大赛——应急响应内存镜像分析(超详细解析)

4.从内存文件中找到异常程序植入到系统的开机自启痕迹,使用Volatility工具分析出异常程序在注册表中植入的开机自启项的Virtual地址,将Virtual地址作为Flag值提交;DLL dlllist -p 查看一下这个进程的查看一下这个进程的DLL,发现程序是在temp目录下执行的,那这个应该就是恶意软件进程了。5.从内存文件中找到异常程序植入到系统的开机自启痕迹,将启动项最后一次更新的时间作为Flag值(只提交年月日,例如:20210314)提交。

Jay 2532

Rust、Java、Python、C++ 有什么区别?从 CPU 执行到内存管理

从 CPU 执行、内存管理、多核并行和部署四个方面对比 Rust、Java、Python 和 C++,结合原理图解释提前编译、JIT、解释执行与原生库调用的区别,并说明什么样的项目适合用 Rust 重写。

qq_74421990的博客 342

QGC4.0.11界面修改

QGC4.0.11。

超维空间科技的博客 2480

【C++ 基于微服务的即时通讯系统】用户子服务业务接口实现(一):注册、登录与短信验证码

上一篇我们完成了用户子服务的整体框架搭建,基于建造者模式把 MySQL、Redis、ES、服务注册发现等组件全部整合到了服务中,搭好了完整的骨架。框架只是基础,真正的业务价值还是要落到具体的接口实现上。本篇我们就按照业务开发顺序,逐个填充用户服务的核心业务接口,包含昵称注册、用户登录、短信验证码下发、手机号注册这四个基础接口,同时集成阿里云短信服务,梳理每个接口的完整业务流程、代码实现细节以及实际开发中的设计考量。

会当凌绝顶,一览众山小 6603

零售行业中如何通过数据分析优化选品策略

在零售行业,选品策略直接决定了企业的成败。面对琳琅满目的商品选择和瞬息万变的市场需求,零售商常常陷入两难:库存积压导致资金周转困难,或者热销商品断货错失销售机会。这种挑战在竞争日益激烈的市场环境中尤为突出,尤其是在电商与实体店并存的时代,消费者需求的多样性和个性化趋势让选品变得更加复杂。如何精准预测市场需求,优化商品组合,成为摆在每一位零售从业者面前的难题。数据分析的出现,为解决这一困境提供了强有力的工具。

大模型大数据攻城狮的专栏 791

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

编码器协议梳理:SSI、BiSS‑C、EnDat、ABZ,选型怎么定?

做伺服、机器人、精密位移台、转台项目时,编码器协议选型经常是绕不开的一环。很多工程师第一反应是对比分辨率、刷新速率,却忽略协议本身的时序、双向通信能力、容错特性,等到驱动调试阶段才发现匹配不上、延迟超标、无法读取内部温度与告警信息。

ylens的博客 229

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

纯 C++ 配置管理器学习记录:基于标准库 + nlohmann/json 的 ConfigManager

本文记录了基于 C++ 标准库与 nlohmann/json 构建的纯 C++ 配置管理器 ConfigManager,实现线程安全的单例模式,支持 JSON 配置文件加载、分组读取及泛型值提取。通过模板函数自动类型转换并提供默认值兜底,兼容热更新与多线程访问,设计简洁高效,适用于无 Qt 依赖的动态库场景,便于与 Qt 版配置系统无缝迁移。

qq_43441284的博客 202

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

从0实现C++ AI大模型接入SDK(六):Qwen与ChatGPT模型接入——从Chat Completions到Responses API

在上一篇文章中,我们已经完成了DeepSeekProvider的设计与实现,并且通过策略模式,将不同大模型所具备的公共行为抽象成了统一的ILLMProvider接口。除此之外,我们还学习了SSE协议,并独立封装了一个SSEParser,用于解决大模型流式响应过程中所出现的数据边界、JSON解析以及响应结束状态判断等问题。那么,既然我们已经完成了第一个大模型的接入,接下来是不是只需要按照同样的方式,就能够将其他大模型接入我们的ChatSDK呢?实际上,这个问题并没有那么简单。

Face_FeaR的博客 564

【C++】继承

本文系统讲解C++继承机制,涵盖继承的复用优势、访问权限规则(基于Min规则)、对象切片现象、同名成员隐藏特性及默认成员函数的正确实现。重点剖析多继承与菱形继承问题,揭示虚继承如何通过虚基表解决重复基类问题,并最终给出继承与组合的选择建议,强调合理设计对代码可维护性的重要性。

记录在学习过程中学到的知识 61

HarmonyOS7基础属性全解(九):禁用反色 allowForceDark——反色大潮里,这块颜色自己说了算(收官篇)

深色模式早已是应用标配。适配它的"正路"是双份资源(),精细但工作量大;对有大量存量代码的应用,官方从 API 20 起提供了"捷径"——反色能力(Force Dark)反色能力是在深浅色切换时自动对颜色值进行反色或变换。一行 C-API 开启后,深色模式下所有硬编码颜色自动反转,全量适配近在眼前。它是一把大刷子。品牌色#FF6A00的品牌橙反转后变成诡异蓝色,VI 全毁;设计感卡片:暖色调卡片被反转成冷色调,设计稿白做;与深色资源混用的页面:同一页面一半走资源配置、一半走反色,两套逻辑打架。

沉淀所学,分享所思,让热爱与成长同行。商务记录AI实战经验,助力开发者快速成长。 热爱AI,希望做出有影响力的技术成果。 技术点亮生活,分享连接价值与机会。 专注AI落地实战,陪你走好技术每一步。 43

FFmpeg开发基础之 C 语言中的指针(下篇)

指针一旦和数组、函数、动态内存结合,C 语言才真正"活"起来:传址调用让函数能改外部数据,二级指针让函数能改指针本身,malloc/free 让程序能按需伸缩内存,函数指针则支撑起回调机制。把第一篇的 & 与 * 用熟,再对照本篇的实战场景反复写几遍,指针就不再可怕了。// 指向"接收两个int、返回int"的函数。C 的函数参数是"值传递",传进去的是副本。若只传 x、y 本身,函数内改的是副本,外面不变——这是初学者最常见的坑。p 是指针,&p 是指针的地址,类型是 int **。

xiaobai103的博客 189

【C++】stack&queue

本文介绍 stack、queue 与 priority_queue 三种容器适配器,它们不直接管理存储,而是封装 deque 或 vector,仅开放符合语义的接口。通过括号匹配等实例说明其用法,剖析为何不提供迭代器以维护数据结构的抽象性,并深入分析 deque 的分段存储与 priority_queue 的堆调整机制。最后手写适配器并以表驱动测试验证功能正确性。

记录在学习过程中学到的知识 340

Effective STL 条款16:把数据传给旧的C接口

vector 和 string 可安全传递数据给旧的C接口:&v[0] 或 v.data() 提供连续内存首地址,c_str() 返回以\0结尾的只读字符串。空容器需先判空,避免未定义行为;非连续容器如 deque 需先拷贝至 vector。C API 仅可修改元素值,不可改变容器大小,指针生命周期限于调用期间。使用 resize 而非 reserve 确保对象构造正确,保障类型安全与内存一致性。

软件科学-郝学胜 487

2026华为OD机考真题|失灵的键盘(2026.04.15)数组和字符串解析与Python/Java/C++多语言代码

本文解析2026华为OD机考真题《失灵的键盘》(2026.04.15,100分,数组和字符串,Core核心代码模式)。核心思路是从左到右贪心识别tt为b(11)、uu为j(19)并跳过2字符,再用哈希表统计频次后按次数降序、转义值升序排序,时间O(n+k log k),空间O(k)。需注意检查i+1防越界且tt/uu跳2格。

be_Newcode的博客 249

《C++ 多线程详解:线程创建、线程栈空间、线程调度与数据竞争》

本文深入解析C++ std::thread底层机制,阐明线程创建过程:构造函数仅启动线程管理对象,实际执行由操作系统调度。关键点包括:线程对象与实际执行线程分离;每个线程拥有独立栈空间、寄存器状态和线程局部存储,但共享进程代码段、全局变量、堆内存等资源。多个线程并发执行可能导致数据竞争,因共享变量(如全局变量)无保护访问。join()用于等待线程结束并回收资源,避免析构时调用terminate()。理解线程栈独立性有助于正确处理局部变量与参数传递。

2301_81905419的博客 221

C++ 实现 Qwen3.8 准确的Token 计数 原理和代码实现(2)

flyfish

二分掌柜的 332

【C++ 基于微服务的即时通讯系统】用户子服务框架搭建与服务编排

在微服务架构的即时通讯系统中,用户子服务是整个系统的核心基础服务,承接了用户注册登录、信息维护、账号状态管理等核心能力,同时还要支撑用户搜索、头像存储等衍生需求。一个健壮的用户服务,需要合理整合关系型数据库、缓存、搜索引擎、服务注册发现等多个组件,同时对外提供统一的RPC接口。本篇我们基于brpc框架完成用户子服务的整体框架搭建,采用建造者模式分步组装各个依赖模块,把MySQL、Redis、ElasticSearch、etcd服务注册发现、跨服务RPC调用等能力整合到服务中,搭好整个用户服务的骨架。

会当凌绝顶,一览众山小 6627

〖C++ 大模型接入实战〗从一次 HTTP 请求到多轮对话:手写支持 JSON 结构化输出的最小客户端

本文使用 C++17、libcurl 和 nlohmann/json,从零实现一个大模型 API 客户端。通过完整示例演示 HTTP 请求、多轮对话历史管理、JSON Schema 结构化输出、响应解析与错误处理,并说明从 Demo 扩展到实际项目时需要关注的密钥管理、超时设置和上下文控制。

2403_86779341的博客 645

四模型航空发动机剩余寿命预测(LSTM、BiLSTM、CNN-LSTM、CNN-BiLSTM)C-MAPSS数据+代码

四模型航空发动机剩余寿命预测(LSTM、BiLSTM、CNN-LSTM、CNN-BiLSTM)C-MAPSS数据+代码

机器学习之心的博客,关注并私信文章链接,获取对应文章源码和数据。 268

推荐一本 C++ 视觉开发书:《OpenCV 4.5 计算机视觉开发实战(基于 VC++)》,89 元,几十所高校在用

OpenCV 的原生接口是 C++,工业视觉、嵌入式部署、对实时性敏感的场景,最终还是要回到 C++ 上。但市面入门书里,Python 版扎堆,C++ 版要么停留在 2.x/3.x,要么偏学术、不接地气。这本直接锁定,从下载解压、配置 VC 通用开发环境、写第一个测试程序开始手把手走,对 C++ 开发者友好度很高。作者朱文伟有 20 多年 C/C++、Java 开发经验,主导过密码、图形、人工智能产品,合著者李建英同是技术一线。

夏天又到了的专栏 131
上一篇: DreamSpark
下一篇: 藏经阁保护方式研究
vbvan
博客等级 码龄19年 132粉丝 40原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址