小编And*_*ong的帖子

C++ std::priority_queue 使用 lambda 表达式

有语句编译器不能通过。我无法理解。谁能详细告诉我或者如何解决?向你致以最良好的祝愿。

声明如下:

    std::priority_queue<int,std::vector<int>,[](const int& lhs,const int& rhs)
    { 
        return lhs<rhs;
    } > pq;
Run Code Online (Sandbox Code Playgroud)

编译器给出的信息如下:

 type/value mismatch at argument 3 in template parameter list for 
'template<class _Tp, class _Sequence, class _Compare> class std::priority_queue'
Run Code Online (Sandbox Code Playgroud)

cppreference 站点中引入的 std::priority_queue:http : //en.cppreference.com/w/cpp/container/priority_queue

主要结构如下:

template<
    class T,
    class Container = std::vector<T>,
    class Compare = std::less<typename Container::value_type>
> class priority_queue;
Run Code Online (Sandbox Code Playgroud)

c++ lambda c++11

3
推荐指数
2
解决办法
3333
查看次数

安装zookeeper-client-c时build.xml不存在

我是zookeeper的新手,想用c语言学习zookeeper。

我安装zookeeper-client/zookeeper-client-c( release-3.6.2 )按照以下步骤进行。自述文件。

运行./configure时出现一些问题。列出如下。

为什么会出现这个问题呢?怎么解决呢?有人可以给一些建议吗?

cong@pc:~/Program/zookeeper-release-3.6.2/zookeeper-client/zookeeper-client-c$ ./configure 
checking for doxygen... no
checking for perl... /usr/bin/perl
checking for dot... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
.....
.....
configure: building with SSL support
checking for ./generated/zookeeper.jute.c... no
configure: error: jute files are missing! Please run "ant compile_jute" while in the zookeeper top level directory.
cong@pc:~/Program/zookeeper-release-3.6.2/zookeeper-client/zookeeper-client-c$ cd ../../
cong@pc:~/Program/zookeeper-release-3.6.2$ ant compile_jute …
Run Code Online (Sandbox Code Playgroud)

installation apache-zookeeper

2
推荐指数
1
解决办法
1201
查看次数

标签 统计

apache-zookeeper ×1

c++ ×1

c++11 ×1

installation ×1

lambda ×1