The `text-paragraph` class does not exist. If `text-paragraph` is a custom class, make sure it is defined within a `#layer` directive - class

#tailwind base;
#tailwind components;
#tailwind utilities;
#layer base {
body {
#apply font-body text-paragraph leading-6 bg-gray-200;
}
The text-paragraph class does not exist. If text-paragraph is a custom class, make sure it is defined within a #layer directive.
E:/XAMPP/htdocs/laravel/portfolio/resources/css/app.css:1:1
1 | #tailwind base;
| ^
solve error

Related

Why does C++11 fail to treat two template typenames T == U in constructor in a template class?

I could not find a short and better title. :(
Suppose I have a simple C++11 template class definition as below:
#include <utility>
template <typename T>
class A
{
public:
T v;
A(){};
template <typename U>
A(const A<U>& a); // copy ctor
A(A<T>&& a); // move ctor
};
template <typename T>
template <typename U>
A<T>::A(const A<U>& a) // copy ctor
{
v = a.v;
}
template <typename T> // move ctor
A<T>::A(A<T>&& a)
{
v = std::move(a.v); // although moving PODs does not make sense in my example
}
Now, my C++11 code uses the above C++11 class as follows:
int main()
{
A<char> a;
A<float> b(a); // okay
A<char> c(a); // gcc output is as below:
// error: use of deleted function 'constexpr A<char>::A(const A<char>&)'
// note: 'constexpr A<char>::A(const A<char>&)' is implicitly declared
// as deleted because 'A<char>' declares a move constructor or move
// assignment operator
return 0;
}
It gives the error use of deleted function 'constexpr A<char>::A(const A<char>&)'.
However, it compiles and runs properly when I am not using any move semantics in the class definition as below:
#include <utility>
template <typename T>
class A
{
public:
T v;
A(){};
template <typename U>
A(const A<U>& a);
// A(A<T>&& a); // removed move ctor
};
template <typename T>
template <typename U>
A<T>::A(const A<U>& a)
{
v = a.v;
}
My questions are:
Why the gcc compiler is treating the template <typename U> in copy ctor differently in the two situations?
Why does it fail to treat typenames T == U in the presence of move ctor?
Why do I need to explicitly write yet another template
function template <typename T> A<T>::A(const A<U>& a) when using
move ctor?
You haven't written a copy constructor. From [class.copy] in the C++11 standard:
A non-template constructor for class X is a copy constructor if its first parameter is of type X&, const X&, volatile X& or const volatile X&, and either there are no other parameters or else all other parameters have default arguments (8.3.6).
(I see no provision for a template constructor to be called a copy constructor)
and consequently
If the class definition does not explicitly declare a copy constructor, one is declared implicitly
The difference between the two examples is whether or not you have a move constructor:
If the class definition declares a move constructor or move assignment operator, the implicitly declared copy constructor is defined as deleted; otherwise, it is defined as defaulted (8.4)
Defining the move constructor disabled the copy constructor. What you want is a converting constructor, which as the name implies, converts its argument to the type of the class. If your copy/move constructors don't do anything special, either omit or default them. To explain the final piece of your confusion, the reason you can omit the template arguments in your fake copy constructor is because of the injected class name. Meaning that wherever you see A, it's silently substituted for A<T>. I've included it for clarity.
template <typename T>
class A
{
public:
T v;
A() = default;
template <typename U>
A<T>(const A<U>& a);
A(const A<T>& a) = default;
A(A<T>&& a) = default;
};

system verilog : Overridden members system verilog classes

class my_a;
int member1 = 1;
endclass
class my_ea extends my_a;
int member1 = 2;
endclass
Now when I do
my_a A;
my_ea EA;
EA =new();
A=EA;
EA = new(); has given handle to object of type my_ea to class variable EA.
A=EA; passes the same handle (pointer value which points to object of my_ea) to A. So, A.member1 should refer to value 2.
But it refers to value 1. Why?
So far, System-Verilog does not allow overriding of class variables. Only virtual methods can be overridden.
There is nothing like virtual for class members, so parent class can never directly access them. When using class_object.member, the particular class is referred to. Henceforth, this is not possible.
You cannot redefine an existing member by extending a class. You should use virtual methods to access (get/set) them. For instance, I added "get_member1" function to your code, and it returns 2 when called from a base class handle as you wanted.
class my_a;
int member1 = 1;
virtual function int get_member1();
return member1;
endfunction
endclass
class my_ea extends my_a;
int member1 = 2;
virtual function int get_member1();
return member1;
endfunction
endclass
module tb;
initial begin
my_a A;
my_ea EA;
EA =new();
A=EA;
$display("%0d", A.get_member1());
end
endmodule
You can similarly define "set_member1(int value)" function and use it to change its value.
In your case A.member1 should return the original member of its own class. When you are overriding a class members, you are basically hiding the overridden members. Super/base class can never access overridden member in its subclass.
As far as I know, only method identified with virtual, randomize() function and class constraint can be overridden without hiding them from the base class - thus they allow base class to reference to them (polymorphism)
For more info, please find here IEEE 1800-2012 in section 8.14 Overridden members.

Call matlab static method from within another static method

is it possible to call a static method from another static method, both method belonging to the same class? Or is there some special syntax that I am not aware of? Currently I am trying to do the following:
% Circle.m
classdef Circle
methods (Static)
function p = getPi
p = 3.14;
end
function a = getArea( r )
a = r * Circle.getPi * Circle.getPi;
end
end
end
And then:
>> Circle.getPi
ans =
3.1400
>> Circle.getArea(123)
Undefined variable "Circle" or class "Circle.getPi".
Error in utils.Circle.getArea (line 8)
a = r * Circle.getPi * Circle.getPi;
See the section Referencing Package Members Within Packages in the documentation page called "Packages Create Namespaces". Basically it says that normal methods from instances of a class do not require the package prefix, but with static methods it is required. Evidently this applies even when calling a static method, from another class method!
All references to packages, functions, and classes in the package must use the package name prefix, unless you import the package. (See Importing Classes.) For example, call a package function with this syntax:
z = mypack.pkfcn(x,y);
Note that definitions do not use the package prefix. For example, the function definition line of the pkfcn.m function would include only the function name:
[snip]
Calling class methods does not require the package name because you have an instance of the class:
obj.myMethod(arg) or
myMethod(obj,arg)
A static method requires the full class name:
mypack.myClass.stMethod(arg)
The error message shows that your class is utils.Circle, not Circle. Your class is placed inside a package utils.

Does UVM support nested/inner classes?

The code guideline for our verification environment is one class per file.
Sometimes a uvm_object is only needed by 1 other uvm_component, so, following object-oriented theory, we should use nested/inner classes.
Nested classes are fully supported by SystemVerilog. However, are they supported by UVM?
Is it possible to compile something like the following:
class inception_level_1 extends uvm_test;
`uvm_component_utils(inception_level_1)
function new(string name = "inception_level_1", uvm_component parent = null);
super.new(name, parent);
endfunction
class inception_level_2 extends uvm_object;
int a;
`uvm_object_utils_begin(inception_level_2)
`uvm_field_int(a, UVM_DEFAULT)
`uvm_object_utils_end
function new(string name = "inception_level_2");
super.new(name);
endfunction
endclass
endclass
Currently the above code gives a compile error:
** Error: testbench.sv(20): (vlog-2889) Illegal to access non-static method 'uvm_report_warning' outside its class scope.
Full code example here: http://www.edaplayground.com/x/3r8
SystemVerilog has packages, which is the preferred mechanism to "hide" class declarations from other packages.
You will have problems using the field macros, or anything else that tries to reference identifiers from inside the inner class that are defined with the same name in both the global uvm_pkg and the outer class. All the uvm_report_... methods are defined in both because uvm_component is extended from uvm_report_object, and uvm_report_... is in the global uvm_pkg.
You will also have problems using the factory with nested classes. Only the outer class will be able to provide overrides by type, but string based overrides by name are global. So even if you nested the inner class, scopes other than the outer class will be able to provide it as an override by string name.
I changed the code to remove the field macros and this runs. So it seems like this is supported if you can give up the field automation macros: http://www.edaplayground.com/x/i5
class inception_level_1 extends uvm_test;
`uvm_component_utils(inception_level_1)
function new(string name = "inception_level_1", uvm_component parent = null);
super.new(name, parent);
endfunction
class inception_level_2 extends uvm_object;
int a;
`uvm_object_utils(inception_level_2)
function new(string name = "inception_level_2");
super.new(name);
endfunction
endclass
endclass
in general it does work. however there are situations where UVM uses shortcuts which conflict with the class-in-class scenario. examples are
string based factory (inception_level_2 can only be registered once despite that foo:inception_level_2 and bla::inception_level_2 would be different classes)
name lookup collision (here for uvm_report_warning which should goto uvm_pkg::uvm_report_warning and not to the enclosing class uvm_component::uvm_report_warning)
... etc

Why isn't my static member function recognised across assemblies?

I have a helper assembly which includes a function to identify object types:
namespace Util
{
using namespace System;
public ref class CastingHelpers
{
public:
template < class T, class U >
static System::Boolean isinst(U u);
static bool Test() {return true;}
};
}
...but for some reason, when I try and use it in a gui application which references the assembly:
Util::CastingHelpers::Test();
Util::CastingHelpers::isinst<SomeClass^>(someInstance);
..gives me an error:
2>.\DataProcessor.cpp(161) : error C2039: 'isinst' : is not a member of 'Util::CastingHelpers'
Note that test works fine. Is this something to do with the fact that isinst uses generics?
You are not creating a generic function, you are creating a C++ template function which is not exported from the assembly.
Use the keyword generic instead of template to create .NET generic types and methods.
The template method is only visible by code that #includes its declaration.