cost 77 ms
boost 词法转换错误:将字符串转换为 unsigned long long 时,源类型值无法解释为目标 - boost bad lexical cast: source type value could not be interpreted as target when converting a string to unsigned long long

我在wandbox.org上编译的以下代码段导致了以下错误。 我不明白为什么我收到错误。 启动 prog.cc:在函数 'int main()' 中:prog.cc:11:15: 警告:未使用的变量 'result' [-Wunused-variable] 11 | Ulonglong r ...

模板化的get方法可从表中检索混合数据类型 - Templated get method to retrieve mixed data types from table

我知道标题没有意义,找不到更好的名称。 我需要为SQlite表提供C ++接口,在其中可以存储键/值/类型配置设置,例如 为了简单和灵活起见,数据模型将值托管为字符串,但提供一列以保留原始数据类型。 这就是我想象的一个客户端调用这种c ++接口的方式。 这就是我想象的 ...

scanf,printf和boost :: lexical_cast本质上是不安全的吗? - Are scanf, printf and boost::lexical_cast fundamentally unsafe?

我最近遇到了一个将十进制字符串(例如"10.057" )转换为double 。 这个问题是与全球应用的语言环境,使用boost::lexical_cast和一些欧洲语言环境中使用的事实,为小数点。 该家族中的scanf , printf和其他功能存在相同的问题。 我很想听听其他人如 ...

boost::lexical_cast 与 boost::units::quantity 不再编译 - boost::lexical_cast with boost::units::quantity does not compile any more

我在解析通过 boost_program_options 获取的值到 boost::units 数量的代码有问题。 它曾经工作得很好,现在,在新的设置上,不再工作了。 模糊的错误消息暗示了 boost::lexical_cast 的问题,它似乎被 program_options 使用。 一个最小的 ...

为 boost::property_maps 中的枚举专门化 boost::lexical_cast - specializing boost::lexical_cast for enums in boost::property_maps

我正在尝试使用在其捆绑的顶点属性中具有enum的boost::graph 。 当我尝试将捆绑属性用于 boost::dynamic_property 时,问题就开始了。 看起来我无法为 boost::lexical_cast 获得正确的模板特化来识别类型。 如果我尝试直接编写enum ,则一切正 ...

捕获boost :: bad_lexical_cast时,我可以访问要投射的字符串/令牌吗? - When catching a boost::bad_lexical_cast, can I access the string/token which was to be cast?

我正在运行的代码可能会在投射一系列令牌时抛出boost:bad_lexical_cast但我无法进入代码并将令牌“抛在一边”,因此我可以弄清楚实际投放失败了。 boost:bad_lexical_cast是否boost:bad_lexical_cast让您访问它尝试以某种方式进行转换的字符 ...

转换字符串令牌流时如何避免重复的istringstream构建 - How to avoid repeated istringstream construction when converting stream of string tokens

我(打算)使用此答案中的代码从CSV中读取内容。 本质上,我得到了一个在连续的,字符之间的字符串的迭代器; 但是我不想将它们放在字符串向量中,而是想将这些字符串解析为(任意)类型T的元素,该元素来自模板参数。 所以... 我可以使用一个istringstream`(例如在这里建议) ...

对于小于双倍范围的值,启用boost :: lexical_cast会超出范围错误 - Enable boost::lexical_cast to throw out of range error for values smaller than double range

boost::lexical_cast会为大于double的最大值的值抛出错误。 但是对于小于最小值的数字,它会默默地将其设为零。 如何为以后的情况启用超出范围的错误(即如果一个数字小于2.22507e-308,那么解析器应该抛出一些错误)? ...

歧义运算符>>在Mac OSX上使用Boost 1.59 lexical_cast - Ambiguous operator>> using Boost 1.59 lexical_cast on Mac OSX

在使用带有重载输入/输出运算符的自定义类使用boost :: lexical强制转换时,在Max OSX上进行编译时,我得到的模棱两可的重载运算符>>。 在这种情况下,Boost 1.59是使用Macports安装的。 下面是一个独立的示例,说明了错误和所需的结果: #in ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM