[try Beta version]
Not logged in

 
Compilation error

Jul 1, 2020 at 3:45am
Hi, what kind of error is this(See below)? My code works, but I received this error which I have never seen before. Can anyone explain what this is and what I should do about this? Thanks.


see reference to function template instantiation 'std::pair<int,int>::pair<size_t,size_t,0>(_Other1 &&,_Other2 &&) noexcept' being compiled
with
[
_Other1=size_t,
_Other2=size_t
]
Last edited on Jul 1, 2020 at 3:46am
Jul 1, 2020 at 5:14am
It's a fragment of an error message.

Any error message should be labelled with "error: " along with the location in the source where the error was detected. You'll need to post the entire error message (or at least the first few lines, if it is very long), and the relevant code.
Last edited on Jul 1, 2020 at 5:15am
Jul 1, 2020 at 5:21am
C:\Users\.....): note: see reference to function template instantiation 'std::pair<int,int>::pair<size_t,size_t,0>(_Other1 &&,_Other2 &&) noexcept' being compiled
with
[
_Other1=size_t,
_Other2=size_t
]
C:\Users\.....: note: while compiling class template member function 'void cs114::RenderingVisitor<T>::visit(cs114::Triangle<T> &)'
with
[
T=`anonymous-namespace'::vector
]


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
namespace cs114
{
	template <typename T>
	class Triangle
	{
	public:
	private:
	};
	template<typename T>
	class RenderVisitors 
	{
	public:
		void visit(Triangle<T>& triangle);

	private:

	};

}

namespace cs114
{
	template<typename T>
	void RenderVisitors<T>::visit(Triangle<T>& triangle)
	{

	}
}

int main()
{
	cs114::RenderVisitors<int> rv;
	cs114::Triangle<int> t;
	rv.visit(t);
}
Jul 1, 2020 at 5:26am
Your code here compiles fine. It doesn't look like the one that sparked the error. What's with the vector in your error message?
Jul 1, 2020 at 5:30am
Yes, I am trying to figure that out too. I am having difficulties figuring out why the compiler is saying "anonymous-namespace vector for T".
Jul 1, 2020 at 5:44am
You still haven't actually posted the error!
Jul 1, 2020 at 5:49am
Oh, sorry these are not errors. My bad. They are warnings treated as errors.
Jul 1, 2020 at 5:49am
You still haven't posted the warning!

Also, what compiler are you using?

And is the code you posted above the exact code you are compiling (with nothing missing)?
Last edited on Jul 1, 2020 at 5:54am
Topic archived. No new replies allowed.