F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_38621163_25244.cpp: In constructor 'SegTree<Info, Tag>::SegTree(int, const std::vector<Info>&)':
0_0_38621163_25244.cpp:16:9: error: 'function' was not declared in this scope
         function<void(int, int, int)> build = [&](int u, int l, int r) {
         ^~~~~~~~
0_0_38621163_25244.cpp:16:9: note: 'std::function' is defined in header '<functional>'; did you forget to '#include <functional>'?
0_0_38621163_25244.cpp:3:1:
+#include <functional>
 using namespace std;
0_0_38621163_25244.cpp:16:9:
         function<void(int, int, int)> build = [&](int u, int l, int r) {
         ^~~~~~~~
0_0_38621163_25244.cpp:16:18: error: expected primary-expression before 'void'
         function<void(int, int, int)> build = [&](int u, int l, int r) {
                  ^~~~
0_0_38621163_25244.cpp:26:9: error: there are no arguments to 'build' that depend on a template parameter, so a declaration of 'build' must be available [-fpermissive]
         build(1, 1, n);
         ^~~~~
0_0_38621163_25244.cpp:26:9: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
0_0_38621163_25244.cpp: In instantiation of 'SegTree<Info, Tag>::SegTree(int, const std::vector<Info>&) [with Info = Info; Tag = Tag]':
0_0_38621163_25244.cpp:113:40:   required from here
0_0_38621163_25244.cpp:26:14: error: 'build' was not declared in this scope
         build(1, 1, n);
         ~~~~~^~~~~~~~~
0_0_38621163_25244.cpp: In instantiation of 'void SegTree<Info, Tag>::pushdown(int, int, int) [with Info = Info; Tag = Tag]':
0_0_38621163_25244.cpp:52:9:   required from 'void SegTree<Info, Tag>::modify(int, int, int, int, int, const Tag&) [with Info = Info; Tag = Tag]'
0_0_38621163_25244.cpp:62:9:   required from 'void SegTree<Info, Tag>::modify(int, int, const Tag&) [with Info = Info; Tag = Tag]'
0_0_38621163_25244.cpp:118:39:   required from here
0_0_38621163_25244.cpp:34:9: error: could not convert '((SegTree<Info, Tag>*)this)->SegTree<Info, Tag>::lazy.std::vector<Tag, std::allocator<Tag> >::operator[](((std::vector<Tag, std::allocator<Tag> >::size_type)u))' from '__gnu_cxx::__alloc_traits<std::allocator<Tag>, Tag>::value_type' {aka 'Tag'} to 'bool'
         if (lazy[u]) {
         ^~


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-07-09 05:36:27, Gzip enabled