谷物编译并运行,但不写入文件

时间:2019-03-06 14:59:33

标签: c++ cereal

以下代码未写入文件。

#include <cereal/types/vector.hpp>
#include <cereal/archives/xml.hpp>
{
    vector<int> v = { 1,2,3 };
    stringstream s;
    s << "cereal_test.xml";
    cereal::XMLOutputArchive  oarchive(s);
    oarchive(v); 
}

它显然可以正确编译并运行。

如果我们cout << s << endl;超出范围,我们会在控制台中看到:

cereal_test.xml
<?xml version="1.0" encoding="utf-8"?>
<cereal>
        <value0 size="dynamic">
                <value0>1</value0>
                <value1>2</value1>
                <value2>3</value2>
        </value0>
</cereal>

缺少什么?

1 个答案:

答案 0 :(得分:0)

谷类食品的错误粘贴粘贴:

应为w = Window.partitionBy('id','player') df = df.withColumn('latestDate', max('date').over(w))\ .where(col('date') == col('latestDate')).drop('latestDate') df.show() +---+------+-----+----------+ | id|player|score| date| +---+------+-----+----------+ | 1| alpha| 100|2019-02-13| | 2| beta| 6|2018-02-13| +---+------+-----+----------+ 而不是SELECT s.studname + '-' + m.maincode + '-' + s.subcode FROM Student s INNER JOIN SubandMainGroup smg on smg.subandmainid = s.subandmainid INNER JOIN MainGroup m on m.mubgroupcodeid = smg.mubgroupcodeid INNER JOIN SubGroup s on s.subgroupcodeid = smg.subgroupcodeid

ofstream