【问题标题】:Nested dictionary syntax ICE C++嵌套字典语法 ICE C++
【发布时间】:2014-06-25 18:55:08
【问题描述】:

我遇到了一个关于 ZeroC ICE 字典语法的新手问题。这是我尝试过的,但似乎没有任何效果。

/*What I want to make <flightNo, <hr, month day>>*/
dictionary<int, <short, short>> FlightSchedule;
dictionary<int, dictionary<short, short>> FlightSchedule;

我应该如何写它以符合语法?

【问题讨论】:

  • 不知道 ICE 是什么,但如果您不使用 C++11,则可能需要在右尖括号之间添加空格:&gt; &gt; 在您的第二个变体中,否则看起来对我好。此外,在像这样的问题中看到您从编译器获得的确切错误消息总是很高兴。
  • ICE 是一个多语言框架 - 互联网通信引擎。我m trying to write client - server app. Unfortunately whitespace didnt 工作。

标签: c++ dictionary syntax map ice


【解决方案1】:

在这里我找到了解决方案。

dictionary<short, short> Time;
dictionary<int, Time> FlightSchedule

我想知道是否还有其他解决方案,因为上面的 IMO 语法等于:

dictionary<int, dictionary<short, short>> FS;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-08
    • 1970-01-01
    • 1970-01-01
    • 2010-10-29
    • 2018-01-29
    • 2021-12-20
    • 2012-01-29
    相关资源
    最近更新 更多